[jboss-user] [JBoss Seam] - Re: servlet in seam application
Basel
do-not-reply at jboss.com
Tue Aug 15 07:25:57 EDT 2006
With EJB3 the application server makes sure that your methods are executed within a transaction. This is not the case with Servlets so you have to start and commit the transaction yourself. Here is the code:
| UserTransaction utx = Transactions.getUserTransaction();
| if(utx.getStatus() != Status.STATUS_ACTIVE)
| utx.begin();
| em.joinTransaction();
| utx.commit();
|
The if statement is not required however I needed that in my web application due to an exception that I don't recall right now.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965230#3965230
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965230
More information about the jboss-user
mailing list