I know that this issue has come up before on Hibernate message boards but I still haven't come across any possible solution. The problem is intermittent errors of the type:
net.sf.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions
e.g.
http://www.mail-archive.com/hibernate-d ... 02239.html
in a multi-user tomcat application using Hibernate. I'm terribly worried that this is happening because of concurrent access to the same data by different requests. If so, this must be a problem that other people have encountered since it seems to be a serious impediment to the scalability of Hibernate.
So my questions are:
1. Is this a general problem and is it likely my problem or is it more likely that there is a bug in my code that forgets to close a Session?
2. What solutions have people found for limiting concurrent access to the same persisted data? I'm worried that I have to write an entire layer of logic to prevent this from happening.
Thanks for you help,
Jesse