We are mapping our entities using @SequenceGenerator, and have set the allocationSize to 100. Hibernate generates the primary keys appropriately.
We now have a background job that comes and must insert a set of new records into the table. After this process completes, we want to force Hibernate to reset its allocation block and read the next set of IDs from the sequence once again.
Otherwise, hibernate would generate next set of IDs (based on IDs left in the allocation pool) that may overlap with the new records entered by the process.
Is there a way to clear the allocation pool and force hibernate to reload the sequence nextval? A system wide setting will also do (i.e. force reload for all sequences)