In updating an object, while in a transaction (I am using it with
spring.net and using spring's declarative transaction management), I
need to retrieve the persistent copy of the object from the database
and then compare it with the object that is passed in to my method.
After performing my check, I try to update the original object that
was passed in and get the error that another object is already
associated with this id in cache.

UpdateMyObject(object o1)
{
     1. retrieve o2.
     2. compare o2 with o1.
     3. try to save o1.
}

I assume what is happening is that when o2 is retrieved, it gets in
the session cache.  So when I try to update o1 in step 3, I get this
error.

I tried to evict o2 after step 2 by calling Evict on the current
session, but that did not make any difference.  Can anyone please
help.

Thanks in advance.

Waqar

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to