Adrian,

thank's for the fast reply. I've read the FAQ before posting this question. I 
have also read them after your reply but I don't find an answer to my question. 
The most interesting article is: TransactionalMessageProcessing (the author 
wants to avoid TPC like I would like to) but I doesn't deal with MDBs and I 
don't know how to port it to MDB. I simple tried to use the same Datasource for 
Hibernate and JMS but this doesn't work as I expect it to work, because than 
the MDB takes two connections from the pool and I get deadlock (rarely) that 
are broken via the attached Exception. My solution for this was to use to 
different Datasources for Hibernate and JMS. But what I really want is using 
one connection instead and one commit per "onMessage" invocation. I this 
possible?

Thank's in advance.

Jobst

org.hibernate.exception.GenericJDBCException: Cannot open connection
        at 
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
        at 
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
        at 
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at 
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
        at 
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:314)
        at 
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:114)
        at 
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
        at org.hibernate.loader.Loader.doQuery(Loader.java:661)
        at 
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
        at org.hibernate.loader.Loader.loadEntity(Loader.java:1782)
        at 
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:47)
        at 
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:41)
        at 
org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2712)
        at 
org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
        at 
org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
        at 
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
        at 
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:177)
        at 
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
        at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:781)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:721)
        at org.hibernate.impl.SessionImpl.get(SessionImpl.java:714)
        at 
de.tmobile.conan.workflow.WorkflowDAO.getWorkflowById(WorkflowDAO.java:24)
        at 
de.tmobile.conan.workflow.WorkflowManagerHibernateImpl.getWorkflow(WorkflowManagerHibernateImpl.java:42)
        at 
de.tmobile.conan.workflow.WorkflowProcessorImpl.handleMessage(WorkflowProcessorImpl.java:99)
        at 
de.tmobile.conan.ejb.WorkflowProcessorMDEJB.onMessage(WorkflowProcessorMDEJB.java:83)
        at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
        at 
org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:475)
        at 
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
        at 
org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:101)
        at 
org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
        at 
org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
        at 
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
        at 
org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)
        at org.jboss.ejb.Container.invoke(Container.java:873)
        at 
org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1077)
        at 
org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1379)
        at 
org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
        at 
org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:904)
        at 
org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:160)
        at org.jboss.mq.SpySession.run(SpySession.java:333)
        at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
        at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.jboss.util.NestedSQLException: No ManagedConnections available 
within configured blocking timeout ( 30000 [ms] ); - nested throwable: 
(javax.resource.ResourceException: No ManagedConnections available within 
configured blocking timeout ( 30000 [ms] ))
        at 
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:79)
        at 
org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
        at 
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:311)
        ... 46 more
Caused by: javax.resource.ResourceException: No ManagedConnections available 
within configured blocking timeout ( 30000 [ms] )
        at 
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:246)
        at 
org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:566)
        at 
org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:410)
        at 
org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:342)
        at 
org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:462)
        at 
org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:894)
        at 
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:73)
        ... 48 more


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3923836#3923836

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3923836


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to