>Hi,

 >we have a stateless session bean with a method called placeOrder that calls
 >the create methods of two entity beans, where each of them is supposed
 >to create one row in two different db tables.

 >The session beans transaction type is "Container" and the transaction 
attribute
 >in the assembly descriptor element is set to "Required" for all of its 
methods.

 >Now if the the second create fails somehow throwing an exception out of 
placeOrder
 >we'd expect the first create to be rolled back, but that does not happen.

We also tried using an explicit rollback from a user transaction within the 
calling servlet, like:

Context ctx = new InitialContext();
UserTransaction utx = (UserTransaction)ctx.lookup("java:comp/UserTransaction");
utx.begin();

try{
        order = shop.placeOrder( cart );
        utx.commit();

     }catch( Exception e ){
        utx.rollback();
     }


That did not work either.
 >Any ideas ?

--Jochen Strunk



(-) Jochen Strunk
(-) SIGNAL 7 Gesellschaft f�r Informationstechnologie mbH
(-) Br�der-Knau�-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665402, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de

Reply via email to