6 messages in com.mysql.lists.clusterTransactions (not rolling back on error)
FromSent OnAttachments
Cor...@ SkyVantage14 Dec 2005 23:44 
Jonathan Miller15 Dec 2005 06:07 
Cor...@ SkyVantage16 Dec 2005 23:42 
pek...@mysql.com17 Dec 2005 02:36 
Cor...@ SkyVantage17 Dec 2005 09:16 
pek...@mysql.com17 Dec 2005 15:15 
Subject:Transactions (not rolling back on error)
From:Cor...@ SkyVantage (las@skyvantage.com)
Date:12/14/2005 11:44:33 PM
List:com.mysql.lists.cluster

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.