I have a question about Hibernate saving/updating entire object tree:
1. The presentation layer requests a deep copy of parent object, then it modifies the parent object as well as some of its children objects as per the form data. The session at this point is closed.
2. After modifying the parent/child objects, the presentation layer calls businees and then Data layer to save it.
3. The data layer will again gets the session associated with the same thread. As the session is already closed, it will open a new session and does the saveOrUpdate operation.
In above scenario, I am worndering if Hibernate will update entire tree of parent object or will it only update the corresponding tables of modified objects ?
I do not see dirty bits in the POJO itself, so wondering how Hibernate will ever know the object's set method is called out of the session. If it does not, will it update unnecessary tables which might be an overhead.
Thank you.
Ram Mahajan
|