Re: Getting DBCP Exception

2005-06-14 Thread Anto Paul
On 6/14/05, ajay kumar [EMAIL PROTECTED] wrote:
 Hi Everybody,
 
  This is Ajay Kumar.I implemented DBCP through tomcat
 container.Some times when i run the webpages it is giving the
 following Exception:
 
 org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Server
 connection failure during transaction. Attempted reconnect 3 times.
 Giving up
 

What database you are using ? Read this doc
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Common%20Problems

-- 
rgds
Anto Paul

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Getting DBCP Exception

2005-06-14 Thread Jon Wingfield

Ajay,

That's a mySQL error message.
In the jdbc url you can add parameters to automate reconnection:

extract-from-doco
autoReconnect   should the driver attempt to re-connect if the 
connection dies? (true/false) - false


maxReconnects   if autoReconnect is enabled, how many times should the 
driver attemt to reconnect? - 3


initialTimeout  if autoReconnect is enabled, the initial time to wait 
between re-connects (seconds) - 2

/extract-from-doco

If you've already have this set, do you see the Exceptions when/after 
you bounce the database? I think you can also see this error message if 
an admin kills a running database query from the processlist - the 
client thinks the database has gone away.


If the above aren't the problem then maybe the communication between the 
client and mysql server isn't fast enough. You may have to tweak the 
client and server connection timeout parameters (in my.cnf in the server).


You can also configure DBCP to give a pooled connection a kick to stop 
it timing out (mysql times out idle connections after, IIRC, 8hrs by 
default).


The parameter you need to set is validationQuery as per:
http://jakarta.apache.org/commons/dbcp/configuration.html

HTH,

Jon

Anto Paul wrote:

On 6/14/05, ajay kumar [EMAIL PROTECTED] wrote:


Hi Everybody,

This is Ajay Kumar.I implemented DBCP through tomcat
container.Some times when i run the webpages it is giving the
following Exception:

org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Server
connection failure during transaction. Attempted reconnect 3 times.
Giving up




What database you are using ? Read this doc
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Common%20Problems





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Getting DBCP Exception

2005-06-13 Thread ajay kumar
Hi Everybody,

 This is Ajay Kumar.I implemented DBCP through tomcat
container.Some times when i run the webpages it is giving the
following Exception:

org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Server
connection failure during transaction. Attempted reconnect 3 times.
Giving up

 I think it is the problem with the values which are
mentioned in the server.xml for DBCP.Here are the details of
server.xml

parameter
  namemaxActive/name
  value100/value
/parameter
parameter
  namemaxIdle/name
  value20/value
/parameter
parameter
 namemaxWait/name
 value1/value
/parameter
parameter
  nameremoveAbandoned/name
  valuetrue/value
/parameter
parameter
  nameremoveAbandonedTimeout/name
  value300/value
/parameter
parameter
   namelogAbandoned/name
   valuetrue/value
/parameter

If any body know the solution please mail me the
details.Thanks in advance...

-- Ajay


-- 
Ajay

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]