Re: Question about LocalTransaction and Transaction Context
Benjamin BONNET <[email protected]> Fri, 15 Nov 2002 09:19:59 +0100
| Newsgroups | gmane.comp.java.sun.connector |
|---|---|
| Message-ID | <[email protected]> |
Hi,
When you invoke getLocalTransaction on a CCI connection, it is in order to
demarcate a transaction "by hand", i.e. without the help of the transaction
manager.
So I think you should not run your code inside a transaction context, may it be a
BM transaction (getting the UserTransaction etc. as you suggest it) or a CM
transaction (setting your method transactionnal declaratively).
Compare this with the use of JDBC java.sql.Connection.commit()/rollback() in a
session bean
Regards
Gurudev Parmar a écrit :
> Hi,
> I am invoking the following in a Bean demarcated Session Bean
> method:
>
> method{
> ....
> con = getConnection();
> ltx = con.getLocalTransaction();
> ltx.begin();
> //Do some stuff
> ltx.commit();
> con.close();
> }
>
> My question is do I have to invoke the above "inside"
> a Transaction Context , like, between userTransaction.begin()
> and commit()?
>
> Thanks,
> Gurdev
>
> ===========================================================================
> To unsubscribe, send email to [email protected] and include in the body
> of the message "signoff CONNECTOR-INTEREST". For general help, send email to
> [email protected] and include in the body of the message "help".