[jboss-user] [EJB 3.0] - Re: Are transactions used by default or do i HAVE to write t

scraatz do-not-reply at jboss.com
Wed Jul 19 07:52:25 EDT 2006


Markus,

from what I know, you do not need the Transaction code and should not use em.getTransaction() in EJB3 session beans.
A session bean method is by default starting a transaction (when none is active) which is commited when the method succeeds and rolled back when the method throws an exception. The injected entity manager lives only as long as the method runs and is auto-closed by the container.
The em.getTransaction() returns a resource (JDBC?) transaction which is not the same as the UserTransaction you can lookup from JNDI.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959093#3959093

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959093



More information about the jboss-user mailing list