Hello, so you have a problem that database connection is closed, and you want 
to fix it by closing the connection?

https://learn.microsoft.com/en-us/sql/connect/jdbc/understand-timeouts?view=sql-server-ver16

"socketTimeout applies to all socket communications with the server. If the 
server stops communication with the driver, either by not acknowledging or 
replying to data, the driver waits for the value of socketTimeout before it 
closes the connection. Setting this timeout to a nonzero value ensures 
applications can remain responsive if there's network or communication failure 
with the server. The default value is 0, which means an infinite timeout. 
Ensure socketTimeout is greater than queryTimeout to avoid socket timeout 
exceptions during the queryTimeout window. Similarly, ensure socketTimeout is 
greater than cancelQueryTimeout to avoid socket timeout exceptions during the 
cancelQueryTimeout window."

Also if you are using Tomcat database connection pool:

https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html#Common_Attributes

Lot of options to check database connections.

-Harri

-----Original Message-----
From: Kenaw, Seretseab <seretseab.ke...@ecolab.com.INVALID> 
Sent: maanantai 14. lokakuuta 2024 19.16
To: users@tomcat.apache.org
Subject: Connection reset by peer: socket write error

[Et saa yleensä sähköpostia seretseab.ke...@ecolab.com.invalid. Lisätietoja 
siitä, miksi tämä on tärkeää, on osoitteessa 
https://aka.ms/LearnAboutSenderIdentification ]

Hello,

We have an application hosted on Azure VM that runs on a Tomcat server and has 
a backend of Azure SQL database . There is a job that purges old data from the 
backend database and keeps failing after it runs for a few hours because the 
connection to database is getting closed for some reason. We were wondering if 
there was a timeout setting on Tomcat that would close connections from the 
connection pool if it stayed open waiting for a response from the database for 
too long? I appreciate any help.


Thank you,

Seretseab K.




CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may 
contain proprietary and privileged information for the use of the designated 
recipients named above. Any unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended recipient, please 
contact the sender by reply e-mail and destroy all copies of the original 
message.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to