openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: Multiple concurrent threads attempted to access a single broker
Date Thu, 22 Sep 2011 16:36:59 GMT
Hi Chintan,
  The error message is rather obvious -- in not it? 
As a suggestion, consider 
private static Map&lt;String, EntityManagerFactory&gt; buEntityMap;
instead of 
private static Map&lt;String, List&lt;EntityManager&gt;> buEntityMap;

EntityManagers have shorter life cycle and not so effective as cached items.
On the other hand EntityManagerFactory are ideally created once in the
entire life time of an application and good candidate to be remembered. 

  See if that solves the problem of multiple threads entering a single
EntityManager. 

 

-----
Pinaki Poddar
Chair, Apache OpenJPA Project
--
View this message in context: http://openjpa.208410.n2.nabble.com/Multiple-concurrent-threads-attempted-to-access-a-single-broker-tp6820896p6820989.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message