HIbernate[hibernate.id.new_generator_mappings=true] creating duplicate keys if older keys are deleted

18 Views Asked by At

I have hibernate application with GenerationType stratergy set to Auto. allocation size is 50. Property "hibernate.id.new_generator_mappings set to "true" it is using pooled optimizer . so it started creating primary key ids with 1. If in between any rows gets deleted , it starts sequence from low (-48 or -49) creates duplicate ids.

Any solution to avoid generating duplicate values. Setting Property "hibernate.id.new_generator_mappings" to "false" solves problem but looking for any other solution. Trying to understand behaviour.

0

There are 0 best solutions below