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
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to