This discussion is archived
3 Replies Latest reply: Oct 25, 2012 7:57 AM by 970685 RSS

Concurrent access issue with JPA  for a Select query?

java4ever Newbie
Currently Being Moderated
Hi All,

I have been trying to understand why this code,
public <T> List<T> findManyNativeSql(String queryString, Class<T> resultClass)
            Query aQuery = getEntityManager().createNativeQuery(queryString,resultClass); // Throwing the following exception
is causing this exception.
<openjpa-1.1.0-r422266:657916 fatal general error> org.apache.openjpa.persistence.PersistenceException: Multiple concurrent th
reads attempted to access a single broker. By default brokers are not thread safe; if you require and/or intend a broker to be
 accessed by more than one thread, set the openjpa.Multithreaded property to true to override the default behavior.
        at org.apache.openjpa.kernel.BrokerImpl.endOperation(
        at org.apache.openjpa.kernel.BrokerImpl.isActive(
        at org.apache.openjpa.kernel.DelegatingBroker.isActive(
        at org.apache.openjpa.persistence.EntityManagerImpl.isActive(
        at org.apache.openjpa.persistence.PersistenceExceptions$2.translate(
        at org.apache.openjpa.kernel.DelegatingBroker.translate(
        at org.apache.openjpa.kernel.DelegatingBroker.newQuery(
I have tried looking at the query which gets printed in the logs when the exception is thrown
[[ACTIVE] ExecuteThread: '32' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR jpa
- ID: 133  queryString= select * from Details where cust_name='SETH'
Any suggestions on the following would be very helpful
Also, AppServer: WL10.3 is being used.



  • Correct Answers - 10 points
  • Helpful Answers - 5 points