-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Cannot open connection on threaded em.createQuery
PostPosted: Tue Apr 08, 2008 8:11 am 
Newbie

Joined: Mon Apr 07, 2008 11:46 pm
Posts: 4
hallo everyone...
i'm using 4 thread to improve my application performance.
on each thread it contain 'em.createQuery' code
i got this following error on that code.
Code:
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection

at first i thought it had problem with database connection setting, but then i realize that other persistence code(CRUD) works well.

the problem is, that error only occurs on the deployment machine. it works perfectly on the development machine. both using same database and same configuration setting.

can anybody tell me what's going on...
is this hardware issue ?

any suggestion greatly appreciated.


Top
 Profile  
 
 Post subject: Re: Cannot open connection on threaded em.createQuery
PostPosted: Tue Apr 08, 2008 10:56 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
What is the full stack trace?


Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 08, 2008 10:03 pm 
Newbie

Joined: Mon Apr 07, 2008 11:46 pm
Posts: 4
Code:
INFO   | jvm 1    | 2008/04/07 15:12:46 | 15:12:46,062 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
INFO   | jvm 1    | 2008/04/07 15:12:46 | 15:12:46,062 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57eb21:536:47f9d32c:97 status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57eb21:536:47f9d32c:97 status: ActionStatus.ABORTED >)
INFO   | jvm 1    | 2008/04/07 15:12:46 | 15:12:46,125 ERROR [JmsServerSession] Unexpected error delivering message org.jboss.mq.SpyObjectMessage {
INFO   | jvm 1    | 2008/04/07 15:12:46 | Header {
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsDestination  : QUEUE.simak/ContentProcessor
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsDeliveryMode : 2
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsExpiration   : 1207557187781
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsPriority     : 4
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsMessageID    : ID:6-12075553877811
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsTimeStamp    : 1207555387781
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsCorrelationID: null
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsReplyTo      : null
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsType         : null
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsRedelivered  : false
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsProperties   : {}
INFO   | jvm 1    | 2008/04/07 15:12:46 |    jmsPropReadWrite: false
INFO   | jvm 1    | 2008/04/07 15:12:46 |    msgReadOnly     : true
INFO   | jvm 1    | 2008/04/07 15:12:46 |    producerClientId: ID:6
INFO   | jvm 1    | 2008/04/07 15:12:46 | }
INFO   | jvm 1    | 2008/04/07 15:12:46 | }
INFO   | jvm 1    | 2008/04/07 15:12:46 | javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:245)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at $Proxy100.onMessage(Unknown Source)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.mq.SpySession.run(SpySession.java:323)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:237)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at java.lang.Thread.run(Thread.java:595)
INFO   | jvm 1    | 2008/04/07 15:12:46 | Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at simak.contentprocessor.ejb.ContentProcessorBean.onMessage(ContentProcessorBean.java:291)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at java.lang.reflect.Method.invoke(Method.java:585)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:116)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at java.lang.reflect.Method.invoke(Method.java:585)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    ... 17 more
INFO   | jvm 1    | 2008/04/07 15:12:46 | Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.loader.Loader.doQuery(Loader.java:673)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.loader.Loader.doList(Loader.java:2220)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.loader.Loader.list(Loader.java:2099)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    ... 44 more
INFO   | jvm 1    | 2008/04/07 15:12:46 | Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57eb21:536:47f9d32c:97 status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57eb21:536:47f9d32c:97 status: ActionStatus.ABORTED >)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:47)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    ... 58 more
INFO   | jvm 1    | 2008/04/07 15:12:46 | Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57eb21:536:47f9d32c:97 status: ActionStatus.ABORTED >
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
INFO   | jvm 1    | 2008/04/07 15:12:46 |    ... 60 more


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 08, 2008 11:35 pm 
Newbie

Joined: Mon Apr 07, 2008 11:46 pm
Posts: 4
oh and also, i'd like to point out that the data processed on the deployment machine is ten time bigger than the one on the development machine.
this process took place right before the em.createQuery code

could this heavy process caused my problem ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 09, 2008 12:08 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
pan.pur@gmail.com wrote:
could this heavy process caused my problem ?



Possibly. See if you find transaction timed outs somewhere before these logs. This error says transaction has aborted so it means something has happened to it. If so, increase the transaction time out time.



Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 09, 2008 12:42 am 
Newbie

Joined: Mon Apr 07, 2008 11:46 pm
Posts: 4
ah yes, it works like a charm now
thank you very much mr. Farzad

have a nice day :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.