[jboss-user] [EJB 3.0] - Re: Bean Managed Transaction: No JTA transaction found
rituraj_tiwari
do-not-reply at jboss.com
Sun May 25 04:49:02 EDT 2008
Al,
Thanks for your response. I am doing ut.begin() right after I create the user transaction. This is a simplified version of my worker thread's method:
| InitialContext ctx = new InitialContext();
| EntityManagerFactory emf = (EntityManagerFactory)ctx.lookup( "java:/MyProjectEntityManagerFactory" );
| UserTransaction ut = (UserTransaction)ctx.lookup( "java:comp/UserTransaction" );
|
| EntityManager em = emf.createEntityManager();
|
| ut.begin();
| doPersistentStuff(em);
| ut.commit();
|
I am making sure that there is a single thread that creates EntityManagerFactory, EntityManager and performs the persistent operations.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153203#4153203
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4153203
More information about the jboss-user
mailing list