[jboss-user] [JBoss Seam] - Aborting transactions by clearing the persistence context

karypid do-not-reply at jboss.com
Fri Jan 18 05:29:15 EST 2008


Hi,

I'm rather inexperienced in J2EE and even more so with Seam, so I need some feedback regarding the following "trick" I've come up with:

I have the typical scenario where a web page backed by a stateful session bean is used to edit some entities, with all changes performed in ACID fashion when a "save()" action is called on the SSB.

To gracefully abort the transaction without throwing an exception I simply call em.clear(), and return to another web page that shows a list of entities and a facesMessage that editing was aborted.

In the book "JBoss Seam, simplicity and power beyond Java EE" there's an entire chapter dedicated on rolling back transactions. Why is  the detachment of entities not mentioned? Is there something wrong with this approach?


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

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



More information about the jboss-user mailing list