[jboss-user] [EJB 3.0] - Version is not updated
treespace
do-not-reply at jboss.com
Tue Aug 22 15:01:36 EDT 2006
Merge an entity whose @Value column is 100 and the database shows 101 as expected. Unfortunately the entity returned by em.merge still has value 100. Moreover, calling em.refresh returns an enitity whose value is still 100 even though the database clearly has 101. Consequently, trying to re-save that entity generates the following:
javax.persistence.OptimisticLockException: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction
I am using MySQL 5.1 and JBoss 4.0.4 GA
WORKAROUND: after saving the entity I query the entity manager and in that case the entity @Version column comes back with the incremented value.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966777#3966777
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966777
More information about the jboss-user
mailing list