I am upgrading a project from hibernate 3.3.2GA to 4.3.11.Final and ran into this issue where the native generated id is getting updated after the insert. This was not happening in the 3.3.2 version. I tried debugging but don't see the setter getting called again. We are using hbm files for mapping and there's no update=false option like there is with the JPA annotations.
Any ideas what could be causing this?
Code:
Hibernate: insert into XXX.MEMBER (ID, UOM_ID, SIZ_TX) values (default, ?, ?)
2017-06-24 08:54:17,637 TRACE - binding parameter [1] as [BIGINT] - [3301]
2017-06-24 08:54:17,637 TRACE - binding parameter [2] as [VARCHAR] - [size 1]
Hibernate: insert into XXX.MEMBER(ID, UOM_ID, SIZ_TX) values (default, ?, ?)
2017-06-24 08:54:40,671 TRACE - binding parameter [1] as [BIGINT] - [3301]
2017-06-24 08:54:40,672 TRACE - binding parameter [2] as [VARCHAR] - [size 2]
Hibernate: update XXX.MEMBER set ID=? where ID=?
2017-06-24 08:54:50,410 TRACE - binding parameter [1] as [INTEGER] - [0]
2017-06-24 08:54:50,410 TRACE - binding parameter [2] as [BIGINT] - [2202]
Hibernate: update XXX.MEMBER set ID=? where ID=?
2017-06-24 08:54:50,410 TRACE - binding parameter [1] as [INTEGER] - [1]
2017-06-24 08:54:50,410 TRACE - binding parameter [2] as [BIGINT] - [2203]