When you use the @GeneratedValue
annotation without a strategy OpenJPA defaults to AUTO and most databases OpenJPA supports uses Table generation. The default allocationSize is 50, so I would expect to see your keys go something like 1,2,3,4,5,51,52,53,54,101, etc. This is because each time you restart your EntityManagerFactory(or application) OpenJPA must go back to the database to get another batch of keys.
I'm not sure why you're seeing an allocation of 10, but I'm pretty certain that explains what you are seeing. If you were to enable sql trace (openjpa.Log=SQL=trace
), you would see OpenJPA going back to the DB to get keys.