Although I read in this post
https://www.objectdb.com/forum/2606
that the size of the transaction has no hard limit, our experience shows that we can not commit a transaction exceeding 2GB even though the ObjectDB server runs with Xmx15G.
We get the following exception in our JDO transaction in version 2.8.3_05 using client-server mode:
Caused by: java.lang.NegativeArraySizeException: -2147483648 at com.objectdb.o.FIW.m(FIW.java:87) at com.objectdb.o.BYW.h(BYW.java:707) at com.objectdb.o.BYW.h(BYW.java:717) at com.objectdb.o.RQC.ZG(RQC.java:158) at com.objectdb.o.WSN.a(WSN.java:938) at com.objectdb.o.WSN.YL(WSN.java:677) at com.objectdb.o.STC.e(STC.java:533) at com.objectdb.o.SHN.F(SHN.java:564) at com.objectdb.o.SHN.w(SHN.java:171) at com.objectdb.o.HND.run(HND.java:134) at java.base/java.lang.Thread.run(Thread.java:833)
In such cases we have to split the transaction to smaller pieces and commit them more often.
The tricky part is to find out that we have this situation. The NegativeArraySizeException is not very intuitive. We would expect rather something like TransactionTooBigException.
But what would help us most, would be a way to check the current size of the transaction, so we could even prevent the overflow of array index. For example via providing a public method
Transaction.getSize()
This may not be possible as it is an interface in javax.jdo package. Maybe it could be solved via a special Query like "objectdb backup" which is used for online backuping.