I am upgrading to hibernate 6.6.53_Final from 5.5 and using the hibernate-enhance-maven-plugin with enableDirtyTracking true.
Version is mapped like: @Version @Column(name = "VERSION") public Long getVersion() { return version; }
The enhanced code also seems to track the version: public void setVersion(Long version) { if (isChanged(this.$$_hibernate_read_version(), version)) { this.$$_hibernate_write_version(version); } }
Creating a new hibernate object generates an INSERT statement followed by an UPDATE of the version.
Setting enableDirtyTracking to false however only generates an INSERT statement.
Is this expected behaviour?
I tested with hibernate 7.4.4.Final and the same behaviour is seen, an extra UPDATE for the version if enableDirtyTracking is true.
Please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.
as with any open source project, it is at the discretion of the individuals that contribute to decide what they want to look at. I can’t speak about the priorities of others, but I personally don’t plan to work on this anytime soon and until you create a Jira ticket for it, nobody else from the community will know about this problem. So please, follow the process by creating a ticket, cross reference this discussion and attach/link the reproducer.