Unintended consequences - Transactions

What’s wrong with the following code? using (var transaction = session.BeginTransaction()) { session.Save(something); transaction .Commit(); } Nothing if you are using MySQL connector 6.0, which has the following Dispose method on its MySqlTransaction class. protected override void Dispose(bool disposing) { if ((((this.conn != null) && (this.conn.State == ConnectionState.Open)) || this.conn.SoftClosed) && this.open) { this.Rollback(); } base.Dispose(disposing); } But if you are using 5.0.9, check out this code (which is actually from the underlying DbTransaction object). »

Using MySQL Temporary Tables to save your brain

Reporting….can be a pain. Business requirements for reports often collide with domain models, and leave developers annoyed. Why do you need the first 10 users of every Wednesday, unless their first name is Steve, for the past 6 months, excluding October? MySQL temporary tables can help. Doggie Nail Clippers, LLC Reach back to that great sci-fi imagination of yours, and imagine you are developing a doggie nail tracking application, which tracks information about all your doggie clients. »

Brian Hartsock on #MySQL,