I found that it is impossible to insert a record with @Unique byte[] var;
after initial insertion of a single record.
Below is the exception:
Nbl3hQfe6LHayqZ7TQKivA== iWbldTBdz3etGCqHspWw3Q== Exception in thread "main" [ObjectDB 2.7.4_05] javax.persistence.RollbackException Failed to commit transaction: Unique constraint (id.co.ecoin.test.objectdb.ObjectDbTest$OdbByteArray[key]) failed: Attempt to reuse an existing value (-121) (error 613) at com.objectdb.jpa.EMImpl.commit(EMImpl.java:289) at id.co.ecoin.test.objectdb.ObjectDbTest$OdbByteArray.newInstance(ObjectDbTest.java:87) at id.co.ecoin.test.objectdb.ObjectDbTest.objectDbBasic2(ObjectDbTest.java:52) at id.co.ecoin.test.objectdb.ObjectDbTest.main(ObjectDbTest.java:19) Caused by: javax.persistence.PersistenceException: com.objectdb.o.UserException: Unique constraint (id.co.ecoin.test.objectdb.ObjectDbTest$OdbByteArray[key]) failed: Attempt to reuse an existing value (-121) at com.objectdb.o._PersistenceException.a(_PersistenceException.java:47) at com.objectdb.o.JPE.d(JPE.java:147) at com.objectdb.o.JPE.d(JPE.java:80) ... 6 more Caused by: com.objectdb.o.UserException: Unique constraint (id.co.ecoin.test.objectdb.ObjectDbTest$OdbByteArray[key]) failed: Attempt to reuse an existing value (-121) at com.objectdb.o.MSG.a(MSG.java:64) at com.objectdb.o.SPW.ap(SPW.java:323) at com.objectdb.o.SPW.ar(SPW.java:267) at com.objectdb.o.SPW.ac(SPW.java:115) at com.objectdb.o.PGW.ak(PGW.java:221) at com.objectdb.o.UPT.s(UPT.java:135) at com.objectdb.o.URT.g(URT.java:173) at com.objectdb.o.TSK.b(TSK.java:146) at com.objectdb.o.TSK.c(TSK.java:96) at com.objectdb.o.TSM.a(TSM.java:88) at com.objectdb.o.UTT.r(UTT.java:377) at com.objectdb.o.UTT.g(UTT.java:225) at com.objectdb.o.TSK.b(TSK.java:146) at com.objectdb.o.TSK.c(TSK.java:96) at com.objectdb.o.TSM.a(TSM.java:88) at com.objectdb.o.MST.Zy(MST.java:1421) at com.objectdb.o.WRA.Zy(WRA.java:398) at com.objectdb.o.WSM.Zy(WSM.java:186) at com.objectdb.o.OBM.aP(OBM.java:955) at com.objectdb.o.OBM.aS(OBM.java:855) at com.objectdb.o.OBM.aG(OBM.java:755) at com.objectdb.jpa.EMImpl.commit(EMImpl.java:286) ... 3 more