I am using odmg session bean example packaged with the source distribution . It works 
well but I have one question . 
When I throw and EJBException , or even tx.currentTransaction.abort() only the last 
statement is aborted . I need an all or nothing principal to work
for me . 
 
The code is something like this 
 
Transaction tx = odmg.currentTransaction();
 
....
 
// Save new object to database
tx.lock(objectToInsert, Transaction.WRITE);
 
// Perform an update 
tx.lock(objectToUpdate, Transaction.UPGRADE);
object.setNextId(objectToInsert.getId());
 
throw new EJBException() -> or abort()
 
 
 
 
This code only rolls back the update and not the insert . I need it to rollback both .
Any solutions would help .
 
Thanks
 
Serge


Reply via email to