Ronald, thanks for the unit test. I executed it against mysql, postgres and 
oracle (the real ones and not just h2 in the different modes to be sure), and 
here is what I've found:
+ "  <join name='join'>" /* the default: leads to StaleObjectStateException 
with Oracle and Postgres */
  | //+ "  <join name='join' lock='"+ LockMode.UPGRADE.toString() + "'>"        
 /* works */
  | //+ "  <join name='join' lock='"+ LockMode.UPGRADE_NOWAIT.toString() + "'>" 
 /* works */
  | //+ "  <join name='join' lock='"+ LockMode.NONE.toString() + "'>"           
 /* works */
  | //+ "  <join name='join' lock='"+ LockMode.READ.toString() + "'>"           
 /* works */
  | //+ "  <join name='join' lock='"+ LockMode.WRITE.toString() + "'>"          
 /* invalid lock mode */
  | //+ "  <join name='join' lock='"+ LockMode.FORCE.toString() + "'>"          
 /* StaleObjectStateException */
  | 

So, setting the LockMode seems to be a valid workaround to fix this on Oracle 
and Postgres.

Btw, I have also tried to change the generator type, but that didn't help 
(besides that this is not compatible to the various dbs).

Are you going to check in your unit test?

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

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

Reply via email to