Skip navigation.
Home

Why the socket get Closed ?

al salamo alikom wa rahmat allah wa barakatoh

I've made a web application and i connect to a database (MYSQL), every time the time(day) change(Manualy or automatic)  the socket connection between the DBMS and the application get close, why this happen ? and how can i keep the connection opended.

al salamo alikom wa rahmat allah wa barakatoh

This is normal for the

 
This is normal for the database engine to close the connection if not used so it can be used buy other applications.

If you really need your connection to be opened all the time and never close you can do that (however it is a bad thing) by setting the keep-alive parameter to true.

Consult the  DBCP documentation for more details


Michael's eHome :: Free Coder ...

which time?

Do you mean change the Server hosting the DBMS time or date?


Ahmed Hashim

Software Engineer

hashimblog

al salamo alikom wa rahmat

al salamo alikom wa rahmat allah wa barakatoh

I don't know because the web server which contains the application and the DBMS are on the same machine

al salamo alikom wa rahmat allah wa barakatoh

DB Timer

As Far As I Know, each DBMS has its own Timer, and this time can be used to get time, data also using SQL. So, maybe when you change the server time, this cause an exception or fire event to close the connection because there is conflict in the time between the system time and DBMS time.


Ahmed Hashim

Software Engineer

hashimblog