db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Transactions and saving - problems with commit
Date Thu, 18 Sep 2003 15:46:15 GMT
Hi all,

I have two Torque generated objects, the first is linked to the second 
via a foreign key. When I save the objects, I do this:

contact.save();
company.setContact(contact);
company.save();

And this works fine - both objects are saved correctly, and as they are 
new objects, Torque handles their primary keys.

The trouble starts when the above three statements are saved in a 
transaction. On the "company.save()" an exception is thrown because the 
primary key for contact cannot be found in the database, and the 
transaction support kicks in, rolling everything back.

How do I get around this? It seems that supporting both primary keys and 
rollback at the same time is a catch-22 situation - any ideas what I am 
doing wrong?

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message