> -----Original Message-----
> From: Matthias Lak�mper [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 06, 2003 2:58 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Problems with autocommit true in Jboss
> 
> 
> Hi,
> 
> i think i have found the reason for my Transaction-Problem.
> 
> the problem:
> 
> I have a function which makes different updates and inserts.
> 
> In my testcase the third insert caused an Exception, but the first 
> two inserts stay in the Database in spite of calling a Transaction 
> rollback.
> 
> The reason for this was that the session bean was created 
> before starting the transaction. Now i create the session-Bean after
> starting the Transaction and so everything works fine.

Yes, if the session bean only 'supports' transactions instead of 
'requires' or 'requires new' one, the bean's life/access must begin
within an externally supplied transaction, to be transactional.

> 
> BTW, The test of lConnection.getAutoCommit() gives 
> furthermore true, but
> this has no effect.

Hmm. Do you mean that *within* the doWork method of the session the 
connection reports it is of kind 'autocommit'? (If you acquired
the connection before the begin of 'lTransaction', it is correct
that this is an autocommit connection, and the connection within
your session bean processing is a different one).

Regards
Alexander Schr�der
SAP Labs Berlin

> 
> Regards Matthias Lak�mper
> 
> 
> ------------------Code----------------------------------------
> ----------
>          lSession.remove();
> 
>          lTransaction = (UserTransaction)
>             lContext.lookup( "UserTransaction" );
>          // Start the transaction
>          lTransaction.begin();
> 
>          lSession = lHome.create();
> 
>          lSession.doWork(parameter);
> ------------------Code----------------------------------------
> ----------
> 
> ______________________________________________________________
> ________________
> vCard - noch nie gehoert? Dann schaun Sie mal rein bei WEB.DE 
> FreeMail. 
> http://freemail.web.de/features/?mc=021155
> 
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to