users@glassfish.java.net

Re: Communications Exception after wait_timeout expires in MySQL 5

From: <glassfish_at_javadesktop.org>
Date: Sun, 21 Jun 2009 11:37:35 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>


___________
[url=http://betonline.com/sportsbook]sportsbook[/url]
[url=http://www.northstarlimo.ca/reservations.aspx]toronto downtown to airport[/url]
[Message sent by forum member 'karthick9s' (karthick9s)]

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