Hello,
if we use the version 2.7.4_04 then we get another issues in our test suites.
We worked on enhanced classes.
We activated the entity listeners for pre persisted and post persisted in order to check the entity version number.
For example a new entity is created (entity version = 0), pre persisted (entity version = 0), post persisted (entity version = 1) and committed, during the commit an optimistic lock exception is thrown. The version flag of the entity was unexpectedly incremented and caused the exception.
But if we use the former ObjectDB version 2.7.4_03 then our test suite performs again, we don't get strange effects.
Unfortunately The version 2.7.4_04 is not usable in our tool.
Caused by: com.objectdb.o._RollbackException: Failed to commit transaction: Optimistic lock failed for object com.btc.ep.base.bl.internal.entities.mapping.MappingImpl#'2BO' (object has version 2 instead of 1) [MappingImpl:'2BO']
at com.objectdb.o.JPE.d(JPE.java:91)
at com.objectdb.o.ERR.h(ERR.java:56)
at com.objectdb.o.OBC.onObjectDBError(OBC.java:1582)
at com.objectdb.jpa.EMImpl.commit(EMImpl.java:289)
at com.btc.ep.base.transactions.internal.TransactionManagerImpl.lambda$1(TransactionManagerImpl.java:313)
at java.util.Optional.ifPresent(Optional.java:159)
at com.btc.ep.base.transactions.internal.TransactionManagerImpl.doCommit(TransactionManagerImpl.java:311)
... 45 more
Caused by: com.objectdb.o._OptimisticLockException: Optimistic lock failed for object com.btc.ep.base.bl.internal.entities.mapping.MappingImpl#'2BO' (object has version 2 instead of 1) [MappingImpl:'2BO']
at com.objectdb.o.JPE.d(JPE.java:135)
at com.objectdb.o.JPE.d(JPE.java:80)
... 51 more
Best regards,
BTC-ES team