Is it the Hibernate session cache that makes this happen? Hibernate seems to remember that it has used a certain id and refuses to create a new entity with the same identifier, even though the entity with this id has been removed from the db by another session.
This makes me concerned about how Hibernate works in a multiuser/multithreaded environment. If thread A retrieves an entity and thread B updates it, how will thread A know if it's working with cached data? Or as is the case above, thread A adds an entity, thread B removes it, how is A notified if it's using a cache?
This is rather critical for me to understand so I'd appreciate a comment.
Regards,
Pelle P
|