CastorJDO, JBoss and CMP not returning connection to pool
cwright1 Nov 1, 2002 1:39 PM
Using Castor 0.9.4, JBoss 3.0 and MySql 3.23... I am seeing the following problem:
With JSP based transactions (no ejb involved), Connections appear to be correctly managed and reused. I have verified this has much has possible via the debug logs of MySql ( which show the connection # for each query).
When performing the same query via an EJB the connection count continues to grow - the connection appears to never be returned to the pool.
The EJB's are Stateless Session Beans with Container managed persistence.
And to reiterate, everything works perfectly except for returning the connect to the pool.
The system has been configured as specified by the JBoss example at:
http://www.jboss.org/developers/projects/jboss/castor.jsp
Any tips, hints, pointers or clues would be greatly appreciated.
Thanks,
- clark.
The configuration details:
The CASTOR-SERVICE.xml
../server/default/conf/database.xml
jdo/lqmiDS
0
false
false
false
true
The DATABASE.xml:
The MYSQL-SERVICE.xml
<depends optional-attribute-name="ManagedConnectionFactoryName">
<!--embedded mbean-->
jdbc/lqmiDS
<config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost:3306/lqmi</config-property>
<config-property name="DriverClass" type="java.lang.String">com.mysql.jdbc.Driver</config-property>
<!--set these only if you want only default logins, not through JAAS -->
<config-property name="UserName" type="java.lang.String">lqmi</config-property>
<config-property name="Password" type="java.lang.String">lqmirwpass</config-property>
<!--Below here are advanced properties -->
<!--hack-->
<depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
<depends optional-attribute-name="ManagedConnectionPool">
<!--embedded mbean-->
1
2
5000
10
ByContainer
<depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
<depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager
java:/TransactionManager
<!--make the rar deploy! hack till better deployment-->
jboss.jca:service=RARDeployer
My EJB-JAR.xml for the session bean is:
<![CDATA[No Description.]]>
<ejb-name>usergroupmgr/LmUserGroupManager</ejb-name>
com.lqmi.core.interfaces.LmUserGroupManagerHome
com.lqmi.core.interfaces.LmUserGroupManager
<local-home>com.lqmi.core.interfaces.LmUserGroupManagerLocalHome</local-home>
com.lqmi.core.interfaces.LmUserGroupManagerLocal
<ejb-class>com.lqmi.core.services.usergroupmgr.LmUserGroupManagerEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
DataObjects factory
<res-ref-name>jdo/lqmiDS</res-ref-name>
<res-type>org.exolab.castor.jdo.DataObjects</res-type>
<res-auth>Container</res-auth>
</resource-ref>
The JBOSS.xml:
<enterprise-beans>
<ejb-name>usergroupmgr/LmUserGroupManager</ejb-name>
<jndi-name>ejb/usergroupmgr/LmUserGroupManager</jndi-name>
<local-jndi-name>ejb/local/usergroupmgr/LmUserGroupManager</local-jndi-name>
</enterprise-beans>
<resource-managers>
<resource-manager
res-class="org.jboss.ejb.deployment.JDBCResource">
<res-name>jdbc/lqmiDS</res-name>
<res-jndi-name>java:/jdbc/lqmiDS</res-jndi-name>
</resource-manager>
<resource-manager
res-class="org.jboss.ejb.deployment.CastorJDOResource">
<res-name>jdo/lqmiDS</res-name>
<res-jndi-name>java:/jdo/lqmiDS</res-jndi-name>
</resource-manager>
</resource-managers>