Forums Register Login
About CMP transaction
hi,my friends :
It is a puzzle how to user JTA in my CMP client. I wonder how to gain and use the ejbcontext instance to get a usertransaction ?
You mean a client application that is talking to an EJB? You get the UserTransaction from JNDI:
Context jndiCtx = new InitialContext();
// you may need properties for the InitialContext
UserTransaction tx = (UserTransaction)
// ...
// or tx.rollback();
If you are trying to get the UserTransaction from within a CMP bean, you can not - Entity beans should have declarative transactions (set in deployment descriptor).
Let's get him boys! We'll make him read this tiny ad!
ScroogeXHTML 7.2 - RTF to HTML5 / XHTML converter

This thread has been viewed 433 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 24, 2018 18:09:55.