Not a problem. 

So option 2 it is :-)

anonymous wrote : 
  | If I omit the UserTransaction, then the environment (JBoss) will create one 
anyway for each Connection I open. Are these correct assumptions? 
  | 

Nope. 

In option 2, you are responsible for creating the UserTransaction and 
'demarcating' the transaction boundaries (note, this is much the same as you 
would do with JDBC, just at a different layer (Servlet/JSP).

Option 1, EJB, gives you declarative (automatic) transaction support. 

Everything is bound and ready to go in JNDI when JBoss starts up so there is 
nothing special you need to do in this regard. Just get the UserTransaction, 
start the transaction and commit/rollback the transaction when necessary. 

Again, this is very much like JDBC just at a different layer. 

Note, this is a primary reason people often use EJB/Spring or some other 
framework that automatically does the start/commit/rollback. Servlets/JSF have 
no such declarative transaction model though you can use other frameworks to 
achieve these results inside a Web environment. 

Again, I am not a JSF expert so there may be some tag/configuration that will 
start/rollback/commit for you. You may want to take a look at the JSF doc for 
clarification. 





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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969914
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to