users@glassfish.java.net

Re: JMS connection

From: <glassfish_at_javadesktop.org>
Date: Sat, 20 Jun 2009 14:25:21 PDT

Hi,

connection.close() should be sufficient to close the connection. Do you have it in the finally block or in the preDestroy method? The code in the first post was not complete, i.e. truncated somehow. Maybe you can post the full code snippet again.
The things you can try are either to increase the max-connections on the connection pool or you could limit the pool size for your beans to be lower than the max-connection count on the connection factory.

E,g, you could adjust this sun-ejb-jar.xml to fit your needs.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
<sun-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>SomeBean</ejb-name>
<jndi-name>queue/SomeBean</jndi-name>
<bean-pool>
<steady-pool-size>1</steady-pool-size>
<resize-quantity>2</resize-quantity>
<max-pool-size>200</max-pool-size>
<pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>
</bean-pool>
</ejb>
</enterprise-beans>
</sun-ejb-jar>

Cheers
Chris.
[Message sent by forum member 'chrjohn' (chrjohn)]

http://forums.java.net/jive/thread.jspa?messageID=352212