[jboss-user] [JBoss Seam] - Mysterious "Transaction is not active" when trying to get Co
zeevlazarev
do-not-reply at jboss.com
Mon Oct 9 18:03:42 EDT 2006
Hi,
I'm using jboss-4.0.4 and MySQL.
When I try to get a Connection from java.sql.DataSource obj I get the follwing exception:
Transaction is not active: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=ZEEV/16, BranchQual=, localId
=16])
23:48:10,921 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection at 15
23de0
java.lang.Throwable: STACKTRACE
at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:400)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
at com.compushop.storage.CompushopDatasourceFactory.getCompushopDatasource(CompushopDatasourceFactory.java:55)
at com.compushop.ejb.session.StorageSessionBeanHelper.initCompushopDatasource(StorageSessionBeanHelper.java:47)
at com.compushop.ejb.session.StorageSessionBeanHelper.getStoreProvider(StorageSessionBeanHelper.java:59)
at com.compushop.ejb.session.SessionDSBean.searchCategories(SessionDSBean.java:107)
at com.compushop.ejb.session.SessionDSBean.getCategoryData(SessionDSBean.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
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:359)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
Googling this exception I found that increasing a time out for the TransactionManagerService in jboss-service.xml solves the issue.
So I changed TransactionTimeout attribe from 300 to 3000.
This partly solved my problem. The first datasrc.getConnection()
I pass smoothly. When I try to allocate another connection from a datasource I fail on the same exception "Transaction is not active".
I obtain a datasource object through jndi:
String jndiName = "mydb";
InitialContext ctx = new InitialContext();
datasrc = (DataSource) ctx.lookup("java:" + jndiName);
Connection conn = datasrc.getConnection();
Thanks.
Zeev
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977084#3977084
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977084
More information about the jboss-user
mailing list