[jboss-user] [JBoss Seam] - optimisticlockexception

balamg do-not-reply at jboss.com
Thu Aug 10 13:55:14 EDT 2006


In order to catch an OptimisticLockException inside a EJB method, one has to flush the entitymanager.

try {
     em.flush();
}
catch (OptimisticLockException e) {
    // do stuff
    em.createQuery("select from User").getResultList();
}

when you do that and then in the "catch" block try to reload data from the DB, it does not work because the transaction is closed at this stage.

how can one refresh the internal data in such cases.

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

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



More information about the jboss-user mailing list