PDA

View Full Version : Usage Of DbConnectionBroker


gowdy
02-04-03, 13:26
Hi

I am attempting to use the DbConnectionBroker from javaexchange.com. My setup is MySQL as the db, mm.mysql driver and Resin as the appserver. I am using Java and Jakarta Struts with JSPs on the front end.

When my app starts I create a ConnectionPool class that instantiates a static DbConnectionBroker. In the constructor of my servlets I then say dbPool = ConnectionPool.getInstance, and connection = dbPool.getConnection(). I do my db "stuff" and then call dbPool.freeConnection().

I was wondering if this is a suitable way to proceed. I am occasionally seeing errors relating to Broken Pipes but am not sure if they are related to my usage of the DbConnectionBroker.

Any assistance would be most warmly received.

Kind regards

Mark

jagasumi
09-01-03, 02:55
Mysql has a database parameter for connection Timeout. This may cause Broken pipes error.

try the following in your connect string

jdbc:mysql:xxx.yyy.zzz.aaa?autoReconnect=true


where autoreconnect tries to estabilish silent db connection when a connection is timedout at mysql end.


should work..!!

all the best.