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 ? thanks!
Post by:Dave Landers
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) jndiCtx.lookup("java:comp/UserTransaction"); tx.begin(); // ... tx.commit(); // 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).
The moustache of a titan! The ad of a flea:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database