Ok thanks, that makes a bit more sense. 

You basically have 3 options: 

a)Use the javax.transaction.UserTransaction interface to demarcate transaction 
boundaries in  your Servlet. Doing this will enable you to remove the explicit 
commits from your code, as well as use the default transaction isolation level 
of the driver.

b)Manage the transactions explicitly yourself. This is effectively what you are 
doing now, just with the wrong datasource, <local-tx-datasource>.  This is why 
it worked when you switched to the <no-tx-datasource>. 

c)Wrap your POJO's in an EJB and allow the container to manage the transactions 
for you. 

Generally I prefer the first approach because it keeps your POJO's free of 
transaction code that can be cumbersome to read, and error prone. Further, try 
to leverage as much of the application server facilities as you can, that's why 
it is there. 





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

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

Reply via email to