|
Question on Automatic versioning -
During my testing it appears that Hibernate 3.05 updates the version number of any object that is 'saved' in a session. What is odd, is hibernate appears to update the version number of ALL objects in the session regardless of whether the object changed or not.
Test: Create object A -> save -> A version # = 1
Create object B -> save -> B version # = 1; A version # =2
note: Object A has no relationship with Object B
This test occures within a single DB session. If A is evicted from the session before the second save, its version # is not changed (the expected behavior).
Impact: If my application does a read of many object and saves a single object, my guess is the version # of ALL read objects will be updated (assuming all objects are in the save session).
Do I really have to manage the contents of the the session when saving changed objects (i.e. evict all read but not changed objects) to make sure the version number is not updated incorrectly?
thanks in advance.
|