There is a lot to mule over here. So from a quick smell test... I'll throw out my 2 bits:
Not sure about this, since I haven't played with the "where= in a class tag"... but that may be the issue.
"where (optional) specify an arbitrary SQL WHERE condition to be used when retrieving objects of this class".
So since you are asking hinberate to "select-before-update" to verify the state of you objects, I am wondering if when hibernate selects, it is not pulling up the correct info... and its state is out of sync.
Also check that you have the correct values for the ID's on the second attempt to save. If all is well, it will just try an update of the current objects, that changed. The "select-before-update" is to guarantee you that no one else changed the objects outside of your session scope.
Hope this helps!
_________________ -JT
If you find my replies helpful, please rate by clicking 'Y' on them. I appreciate it.
|