This bug was found in 5.0.9 though it seems to be the same for latest versions as well.
As part of migration from hibernate 4 to 5, system that already have data and thus can't use the new generators (due to them being incompatible) ran into problems with duplicated ids for primary keys because of the shared hibernate_sequence was used instead of sequence per table (entity) that was already existing and with correct information (current value) in postgresql db.
This looks like an issue with wrong parameter name in here:
it uses "sequence" instead of "sequence_name" that is expected here:
PostgreSQL 9.4 with hibernate 5.0.9
I'll give a look, Thanks
, can u provide a test please? Thanks
test case attached - when you run it see the output of the getting sequence number. Please note that this is for local postgresql data base as I found it to be an issue there. Tested with 5.0.9 version as this is the one we currently use. We do plan to upgrade to 5.1.4 soon, will test it with that version as well.
relevan output from the test
hmm interesting as this seems to work fine in 5.1.4, moreover I tested the 5.0.x versions and the first one that does work as expected is 5.0.11. It produces following output:
so talking that into consideration looks like the problem has been already fixed.
, Thanks a lot