may be this is because of MySQL. i found MySQL and Access wiered sometimes. It doesn't support the transaction management. I have a good experience with Oracle, but not with MySQL. hope someones knows the actual cause.
but again i think MySQL sucks. I have heard something bad like the same about MySQL from ranchers.
I cant see any problem in this code.The thing is type of mySQL storage Engine. The default storage engine is myISAM.This does not support transcation management. You have to change the type of storage engine into InnoDB or BDB. Refer mySQL manual to change the storage engine type. That will work fine..