I have a transaction that is very simple, I need to create records in multiple tables that are related. If any one insert statement fails or throws an error I want to rollback the ENTIRE transaction.

I thought that this was the default functionality, but apparently that's not the case here.

I'm running MySQL-Cluster 5.0.something.

Here's a simplified example..

START TRANSACTION;
INSERT INTO....;
INSERT INTO....;
INSERT INTO....;
COMMIT;

I'm getting data inserted into some tables when others (or one) throw an error. What am I doing wrong? Do I need to put in a conditional that checks for an error between each statement? If so, what might that look like?

I guess the reason this is so important to me is that Cluster doesn't enforce Foriegn Key Rules, so it's important that my relationships are maintained by the transaction properly or else I'll have orphaned records all over the place...

Thanks in advance!

Cory.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to