Application lost database connection

Application lost database connection

am 09.03.2010 06:21:34 von Manasi Save

--=_3sxlyuup8qtc
Content-Type: text/plain;
charset=UTF-8
Content-Description: Plaintext Version of Message
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Hi All,

I am really not sure whether this question should be asked here or not but I am hoping that someone must have faced this problem.

My Servers are losing connections with database because of inactivity and on next activity I am getting following error :-

"The last packet successfully received from the server was40939 seconds ago.The last packet sent successfully to the server was 40939 seconds ago, which is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem."

Do I need to change in the application for this or what changes do I need to do to fix this error.

Please provide me some input.

Thanks in advance.

--
Regards,
Manasi Save


--=_3sxlyuup8qtc
Content-Type: multipart/related;
boundary="=_3x044t38ui0w";
start="3x0yz0c6knnk@mail.artificialmachines.com"
Content-Transfer-Encoding: 7bit

This message is in MIME format.

--=_3x044t38ui0w
Content-Type: text/html;
charset=UTF-8
Content-Description: HTML Version of Message
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Content-ID: 3x0yz0c6knnk@mail.artificialmachines.com

Hi All,

 

I am really not sure whether this question should be asked here or not but I am
hoping that someone must have faced this problem.

 

My Servers are losing connections with database because of inactivity and on
next activity I am getting following error :- 

 

"The last packet successfully received from the server was40939 seconds ago.The
last packet sent successfully to the server was 40939 seconds ago, which
 is longer than the server configured value of 'wait_timeout'. You should
consider either expiring and/or testing connection validity before use in your
application, increasing the server configured values for client timeouts, or
using the Connector/J connection property 'autoReconnect=true' to avoid this
problem."

 

Do I need to change in the application for this or what changes do I need to do
to fix this error.


Please provide me some input.

 

Thanks in advance.


--
Regards,
Manasi Save


--=_3x044t38ui0w--

--=_3sxlyuup8qtc--

Re: Application lost database connection

am 09.03.2010 08:51:26 von Hartmut Holzgraefe

Manasi Save wrote:
> Hi All,
>
> I am really not sure whether this question should be asked here or not
> but I am hoping that someone must have faced this problem.
>
> My Servers are losing connections with database because of inactivity
> and on next activity I am getting following error :-
>
> "The last packet successfully received from the server was40939 seconds
> ago.The last packet sent successfully to the server was 40939 seconds
> ago, which is longer than the server configured value of
> 'wait_timeout'.

the server will disconnect idle client connections after wait_timeout
seconds to protect its resources:

http://dev.mysql.com/doc/refman/5.0/en/server-system-variabl es.html#sysvar_wait_timeout

A client idle that long is considered to be either dead or at least
not using the database actively in any way, so that it won't get
hurt by the little extra cost to reestablish the connection ...

> You should consider either expiring and/or testing
> connection validity before use in your application, increasing the
> server configured values for client timeouts, or using the Connector/J
> connection property 'autoReconnect=true' to avoid this problem."
>
> Do I need to change in the application for this or what changes do I
> need to do to fix this error.

the error message should have given you the different ways to deal
with this already?

* server side:

** configure wait_timeout to a higher value

* application side:

** test connection validity before using it, reopening it
manually as needed

** add connection property 'autoReconnect=true' to have
the MySQL Java connector deal with this automatically

--
Hartmut Holzgraefe, MySQL Regional Support Manager, EMEA

Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder, Wolfgang Engels
Vorsitzender des Aufsichtsrates: Martin Häring


--
MySQL Cluster Mailing List
For list archives: http://lists.mysql.com/cluster
To unsubscribe: http://lists.mysql.com/cluster?unsub=gcdmc-cluster@m.gmane.o rg