I am using EclipseLink for a small project to record user activities. I have a class that captures details about the activity and I am using the table generator strategy to generate the primary key ids for that class.
The issue I am facing is that EclipseLink (I will call it EL) is assigning primary keys at an increment of 50 which I understand is the default value for the allocationSize. This is within the same JVM cycle (i.e., no reboot).
I understood that the allocationSize is used for the number of IDs EL would pre-allocate in memory. I would like to use this functionality, but EL doesn’t seem to be working like that.
Only when I change the allocationSize to 1 do I get EL to generate Primary Keys sequentially.
Any help would be greatly appreciated…
I am using EclipseLink 2.3.0.
Thanks everyone for your help.
I have solved my problem. I was manually managing the lifecycle of the EntityManager and the transactions as well. I changed my code to have the EntityManager injected into my EJB and let the container take care of the transactions. I have set the allocationSize to 1000 and getting the desired results. Once again, thanks vels4j, Chris, and James for your help