1 Reply Latest reply on Jul 17, 2008 5:25 AM by Adam Warski

    a different object with the same identifier value was alrea

    talios Newbie

      Hey all,

      Congrats on the envers 1.0GA release! I just updated my install to the new build and unfortunately got the following exception (using Hibernate 3.2):

      2008-07-17 09:52:11,427 [btpool3-4 - http://localhost:8182/customers] ERROR nz.co.smx.rest.TransactionFilter - commit error a different object with the same identifier value was already associated with the session: [smx3.schema3.ContactMech_versions#{id=2000068, _revision=73}]
      org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [smx3.schema3.ContactMech_versions#{id=2000068, _revision=73}]
       at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:168)
       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
       at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
       at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
       at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
       at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
       at org.jboss.envers.synchronization.work.CollectionChangeWorkUnit.perform(CollectionChangeWorkUnit.java:54)
       at org.jboss.envers.synchronization.VersionsSync.executeInSession(VersionsSync.java:112)
       at org.jboss.envers.synchronization.VersionsSync.beforeCompletion(VersionsSync.java:135)
       at com.atomikos.icatch.jta.Sync2Sync.beforeCompletion(Sync2Sync.java:58)
      


      Is there some configuration or schema changes I need to make for this release at all? Or is this more likely a bug?

        • 1. Re:  a different object with the same identifier value was a
          Adam Warski Master

          Hello,

          I think I should send the jars to you before the release for QA :)

          Well, there are no schema changes. I only added generating revision on collection change and you're getting an exception from that (CollectionChangeWorkUnit in the stack trace). So it's most probably a bug.

          The only problem remaining is reproducing it :). Do you know where it happens? What commit mode in hibernate are you using?

          What will probably help temporarily, is to switch off generating revision for collections, by setting

          org.jboss.envers.revisionOnCollectionChange
          to false.

          Adam