I have the problem that Lifecycle.onUpdate() is not called from Session.saveOrUpdate() when the updated object was loaded in the same Session; I didn't notice this before because most of the time I use detached objects. I looked into SessionImpl.saveOrUpdate() and saw that the existence of an EntityEntry causes this behavior. Calling Session.evict() before Session.saveOrUpdate() solved my problem, but it is my impression that the contract of Lifecycle.onUpdate() is violated by this behavior, .i.e. Lifecycle.onUpdate() should be called as advertised. Any opinion about his?
|