Transactions

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
nutkenz
Forum Contributor
Posts: 155
Joined: Tue Jul 19, 2005 12:25 pm

Transactions

Post by nutkenz »

If I'm not mistaken, InnoDB supports transactions, right? Though, how would changes to MyISAM tables intermixed with changes to InnoDB tables in a single transaction be handled through Doctrine?

For example, suppose we have two tables:

BANK1_CLIENTS (InnoDB)
id
balance

BANK2_CLIENTS (MyISAM)
id
balance

BEGIN -- start transaction
UPDATE bank1_clients SET balance = balance - 400 WHERE id=4
UPDATE bank2_clients SET balance = balance + 400 WHERE id=12
ROLLBACK

What would happen? If it'd just break, are there any ways around this?
nutkenz
Forum Contributor
Posts: 155
Joined: Tue Jul 19, 2005 12:25 pm

Re: Transactions

Post by nutkenz »

Anyone?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Transactions

Post by Weirdan »

It won't break, however changes to non-transactional tables will be committed once you perform them and not during the transaction commit. This also means you won't be able to properly roll back the transaction (and if you try you would get er_warning_not_complete_rollback warning) because changes to non-transactional tables won't be rolled back ever.
Post Reply