Hi, If you use container managed transaction and you throw a EJBException (that is a subclass of RuntimeException) then the server has to rollback the transaction. If it doesn't may be due to a bug in WLS5.2.
-- Antoni Reus ----- Original Message ----- From: "Hardy Henneberg" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 19, 2001 9:29 PM Subject: Re: Tranaction rollback > Hi Antoni, > I found out, that setAutoCommit(false) is not nessecary. > Apparently it has been done, when you get the Connection > from the TxDatasource. But letting out that call, didn't solve > the the 'problem'. It seems still nessecary to make an explicit > call to setRollbackOnly() ? > > Hardy > > On Monday 19 November 2001 11:09 am, Antoni Reus wrote: > > Hi, > > > > I you use container managed transaction DO NOT USE the setAutoCommit > > method of java.sql.Connection. > > > > ----- Original Message ----- > > From: "Hardy Henneberg" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Friday, November 16, 2001 10:23 PM > > Subject: Tranaction rollback > > > > > Hi, > > > > > > I have an entity bean - BMP and container managed tranaction, > > > transaction attribute = Required on all methods. I'm using Weblogic 5.2 > > > and Oracle. In ejbCreate() I insert data in a number of tables. If I > > > catch a SqlException > > > > in > > > > > this method, I rethrow it as an EjbException. This should cause an > > > > automatic > > > > > rollback as far as I am informed, but only if I explicit make a call of > > > EjbContext.setRollbackOnly(), the first part of the transaction is rolled > > > back. I get the connection from a TxDatasource pool managed by Weblogic, > > > > and > > > > > I have set autocommit to false, which I think is nessecary for the > > > transaction to be able to rollback. > > > Can someone explain, why rollback is not done automatically ? > > > -- > > > Hardy Henneberg > > > Konsulentfirmaet HHenneberg > > > Gr�nnevej 44 > > > 2830 Virum > > > Danmark > > > tel: (45) 26124565 > > > > =========================================================================== > > > > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the > > > > body > > > > > of the message "signoff EJB-INTEREST". For general help, send email to > > > [EMAIL PROTECTED] and include in the body of the message "help". > > > > =========================================================================== > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > > of the message "signoff EJB-INTEREST". For general help, send email to > > [EMAIL PROTECTED] and include in the body of the message "help". > > -- > Hardy Henneberg > Konsulentfirmaet HHenneberg > Gr�nnevej 44 > 2830 Virum > Danmark > tel: (45) 26124565 > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff EJB-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". > =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
