2 Replies Latest reply on Aug 22, 2006 12:07 AM by treespace

    Need advice on refreshing @Version column


      I need to merge changes an entity instance multiple times. The second merge causes an optimistic lock failure unless I "manually" update the version string:

      original.setVersion( em.merge( original ).getVersion() );

      I cannot use the updated entity returned from merge because I have many reference to the original instance in several lists.

      Calling em.refresh( original ) after em.merge( original ) did NOT update the @Version column. Why doesn't refresh update the version column?