Hibernate version:
1.2
Sometimes things are more confusing when it works better than expected than vice versa. Now I've run into a "problem" like this.
If I reattach an object(-graph) to a isession using session.lock, how can nhib be aware of the changes? I was quite sure that the snapshots were held inside the isession (used when loading the object) and not in the entity itself, nor did I think the entity was aware of the isession but only the other way around.
To me the above makes it impossible to only persist the changes and not update the whole object graph. But, obviously, I'm totally wrong. How does this work? How can nhib keep track of changes/get the original values when reattaching an object to a new isession?
Because this somehow works, I cannot see why SaveOrUpdate() doesn't work the same magical way? This method works as expected (unfortunatly) in a reattached scenario - doesn't keep track of changes, but updates the whole object graph.
Regards
Roger
|