I just ran into the same problem running Hibernate 4.1.7.Final
After reverting back to 3.6.10.Final the problem is gone again.
Problem: The IllegalStateException( "An entity copy was already assigned to a different entity." ) is thrown, but I was not able to track down the exact situations in which it happens.
My logic that uses hibernate gets a modified disconnected instance from a client over the network, then loads the current state of this instance from the database using hibernate by supplying the primary id of the instance. After a few checks the modified version from the client is passed to the merge() function. This sometimes works as it does with hibernate 3.6. but sometimes fails with the described exception.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
I just ran into the same problem running Hibernate 4.1.7.Final
After reverting back to 3.6.10.Final the problem is gone again.
Problem: The IllegalStateException( "An entity copy was already assigned to a different entity." ) is thrown, but I was not able to track down the exact situations in which it happens.
My logic that uses hibernate gets a modified disconnected instance from a client over the network, then loads the current state of this instance from the database using hibernate by supplying the primary id of the instance. After a few checks the modified version from the client is passed to the merge() function. This sometimes works as it does with hibernate 3.6. but sometimes fails with the described exception.