Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Concurrent access issue with JPA for a Select query?

java4everJun 13 2012 — edited Oct 25 2012
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(BrokerImpl.java:1789)
        at org.apache.openjpa.kernel.BrokerImpl.isActive(BrokerImpl.java:1737)
        at org.apache.openjpa.kernel.DelegatingBroker.isActive(DelegatingBroker.java:428)
        at org.apache.openjpa.persistence.EntityManagerImpl.isActive(EntityManagerImpl.java:606)
        at org.apache.openjpa.persistence.PersistenceExceptions$2.translate(PersistenceExceptions.java:66)
        at org.apache.openjpa.kernel.DelegatingBroker.translate(DelegatingBroker.java:102)
        at org.apache.openjpa.kernel.DelegatingBroker.newQuery(DelegatingBroker.java:1227)
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.


--
VR
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 22 2012
Added on Jun 13 2012
3 comments
2,424 views