Hello,
Can you tell me what the merge() method looks at to decide whether an object needs to be updated.
In my application I'm seeing that *any* call to merge on one of my detached objects results in a SQL update call. Looking at the SQL call, it appears that every member of the object is being updated.
The pattern I see is as follows:
1. objects are instantiated (read in from the database) and held in a private collection
2. One of those objects is then 'merge()ed' - this is to ensure the object is not detached - this is necessary as it is very likely that the merge operation may be performed later in another thread.
3. Later at commit (or FlushtoDB() time), I see updates corresponding to the mappings defined in the annotations. (e.g. updates to the base tables, insert/delete operations to any join tables etc.).
The thing is, the application has not specifically updated any of these objects hence the reason for my question - what tells merge() that it needs to refresh the instance from the database?
-Thom
|