Page 1 of 1

Transactions

Posted: Mon Nov 14, 2011 4:26 am
by eazyGen
Hi Guys,

I am building an app that I know will be deployed on a LAMP server but where I am not in control of the MySQL database engine. It could be InnoDB or it could be MyISAM. Or it could be something else for that matter.

My app has some pretty complicated updates that are tightly related and represent what folk call a “transaction”. In other words, and in an ideal world, all my updates should succeed or none should. The classic example is the bank transfer:

UPDATE account1 SET balance=balance-500;
UPDATE account2 SET balance=balance+500;

Both or none please.

I have been reading up on MySQL transactions, commit and rollback etc; and I am seeing what I would more or less expect (my background is with IBM's DB2).

However, I have been searching around, and, from what I have read thus far, it seems that MyISAM does not support row level locking - only table locks (which is madness in my book).

So I thought I would ask here how folk achieve guaranteed transaction integrity if they are forced (by the host for example) to use MyISAM.

Or do you just put up with this db engine limitation?

Many thanks in advance.

S

Re: Transactions

Posted: Mon Nov 14, 2011 4:34 am
by Weirdan
Pretty simple - MyISAM = no transactions.

Re: Transactions

Posted: Mon Nov 14, 2011 6:18 am
by eazyGen
Weirdan wrote:Pretty simple - MyISAM = no transactions.
Fair enough - at least it is clear !!!!

Thanks for the pointer.

S