Web Hosting Forum | Lunarpages

Author Topic: MySQL timeout  (Read 5441 times)

Offline SkillAdvance

  • Spaceship Navigator
  • *****
  • Posts: 82
    • Oracle, Java, Java EE Training
MySQL timeout
« on: July 07, 2010, 02:15:21 PM »
I am working on a simple application using JSP/Servlet and MySQL and I am using the Gefion connection pooling class available from http://webdevelopersjournal.com/columns/DBConnectionManager.java.  I keep getting timeouts with messages similar to this:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.
  at sun.reflect.GeneratedConstructorAccessor103.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
  at java.lang.reflect.Constructor.newInstance

The same code works fine on my development system.  I have read posts about increasing the timeout for connections held in a pool, to avoid this issue.

Since this is a low volume application, connection pooling is probably overkill but I like to do a job properly.  Surely I'll consume more LP resources by opening and closing connections each time they are needed, rather than opening and sharing through a pool.

Either way, it doesn't matter to me but would appreciate an 'official' verdict from LunarPages.

Thanls

Jeremy
JR
_______________________________________________________

SkillAdvance LLC
 Web:     http://www.skilladvance.com
_______________________________________________________

 

Share |