Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Are transactions atomic?

From: Douglas Pearson <biz(at)sunnyhome.org>
Date: Sun Oct 14 2007 - 18:36:38 EDT


Sorry if this is a dumb question, but are SQL transactions in MySQL atomic? I'm using InnoDB tables in MySQL5.

Clearly, transactions have the property that either all updates occur or none do. By atomic, I mean are other queries guaranteed to either see all changes from the transaction or none of them?

An obvious example of the potential problem if they are not atomic (with regards to visibility):

Transaction {
  Query1 - update credits_table with +$20   Query2 - update debits_table with -$20 }

Separate process running periodically:
  Query3 - compute total credits and debits

Could query3 ever see the total of credits and debits as being out of balance?

If the transaction doesn't guarantee that, is there any other way to force atomic visibility?

Doug

-- 
MySQL General Mailing List
For list archives: 
http://lists.mysql.com/mysql
To unsubscribe:    
http://lists.mysql.com/mysql?unsub=lists@pantek.com
Received on Sun Oct 14 18:37:42 2007
Do you need help?X

This archive was generated by hypermail 2.1.8 : Thu Jul 03 2008 - 08:39:50 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library