Hi Serge, when call tx.lock(....) the objects will be collected within OJB, there was no Database call, till the tx was commited by the container. If you throw an EJBException or do abort all collected objects will be discarded. So there shouldn't be any problems. There are serveral rollback test cases all work fine. When using a stateful session bean that keeps the modified object, the modifications on the object will not be rolled back. Maybe I don't understand the problem, maybe you could send a test case to demonstrate the problem.
regards, Armin ----- Original Message ----- From: "Boulay, Serge" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 29, 2002 10:55 PM Subject: ODMG Session Bean oc4j 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 -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
