I've been working on creating a hibernate test case but having some challenges but will continue over the coming days. What I think I'm seeing and maybe it's lack of understanding on my part but it looks from the trace and this [blog http://vladmihalcea.com/2015/01/12/a-beginners-guide-to-java-persistence-locking/] we are doing OPTIMISTIC_FORCE_INCREMENT locks. It looks like in this senario hibernate will update the version number even if this is also been handled in the db as a trigger. So if you are wanting triggers to update this (generated=always) are we supposed to also use in the code a difference locking strategy or is Hibernate supposed to see the generated type on the version field and adjust the locking stategy? |