Im trying to persist/synchronize all user provided data before a session rans out of time within a conversation/pageflow. I need to do this to prevent loosing data and I set the flushMode to manual.
What would be the way to handle this issue?
Im using an @Observer(
inject the EntityManager, check if it is open() and calling flush() method.
Then I get the exception
javax.persistence.TransactionRequiredException: no transaction is in progress.
Im using JTA transaction on WebLogic 10.3.3 and JBoss 4.2.3
So are you dealing with data loss on session time out?
you should try to prevent thse situations, but the thing I do is creating a session bean and add the necessary logic in the destroy method. When the session times-out. The destroy method is called and you could perform some logic (although I prefer a timer ajax push in a page to prevent this, or a simple ajax update for each change).