SqlMapClient don't release connection in a clustered ejb based application --------------------------------------------------------------------------
Key: IBATIS-438 URL: https://issues.apache.org/jira/browse/IBATIS-438 Project: iBatis for Java Issue Type: Bug Affects Versions: 2.3.0 Environment: BEA Weblogic Server 9.2.1 Clustered, Oracle 9i, EJB 2.1, the trasaction manager type is JDBC with a JNDI Datasource type. Reporter: Nicola Amoruso I'm using JDBC transaction manager with very basic configuration. I do many database transactions as update and insert In every business method i call startTransaction() on SqlMapClient defined as private as instance variable into my ejb. At the end of my method i call commitTransaction() if the transaction end right and i call always endTransaction() in a finally block as specified in IBATIS tutorial. This architecture work fine in and environment without clustering, but in this last model i have a abnormal consuming of connections of weblogic connection pool with the following exception: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in file: query.xml. --- The error occurred while executing mapped statement. --- Check the query.update. --- Check the statement or the result map. --- Cause: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:94) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecutorDelegate.java:505) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.update(SqlMapSessionImpl.java:90) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.update(SqlMapClientImpl.java:67) at it.mypkg.ejb.Business.unlockListaPersone(CqscPFBusiness.java:279) at it.mypkg.ejb.Business_17zvgu_EOImpl.businessMethod(Business_17zvgu_EOImpl.java:208) at it.mypkg.ejb.Business_17zvgu_EOImpl_WLSkel.invoke(Unknown Source) at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:518) at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224) at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:408) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147) at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:404) at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:57) at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:935) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) at weblogic.work.ExecuteThread.run(ExecuteThread.java:181) Caused by: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception at weblogic.jdbc.common.internal.RmiDataSource_920_WLStub.getConnection(Unknown Source) at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTransaction.java:48) at com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(JdbcTransaction.java:89) at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:78) ... 16 more Caused by: java.rmi.UnmarshalException: cannot unmarshaling return; nested exception is: java.io.NotSerializableException: weblogic.jdbc.common.internal.ConnectionEnv at weblogic.rmi.internal.ServerRequest.unmarshalReturn(ServerRequest.java:105) at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338) at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252) ... 20 more Caused by: java.io.NotSerializableException: weblogic.jdbc.common.internal.ConnectionEnv at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291) at weblogic.rmi.extensions.server.CBVOutputStream.writeObject(CBVOutputStream.java:84) at weblogic.rmi.internal.ServerRequest.unmarshalReturn(ServerRequest.java:97) ... 22 more I fix the problem adding the following code after every endTransaction() : sqlMapClient.getDatasource().getConnection().close(). Thanks in advance. Nicola -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.