In my application, I create a connection in the "main" and pass it to the controllers. Accordingly, after a long downtime, the connection is closed ...
The question is how to prevent this without creating a connection each time the method that operates with it is called, and not creating it when it is caught in try?
I think the above solutions are not correct, but if there is no other, I want to still hear which of the methods you use ...
- oneWe do not keep connections open for longer than the required minimum, especially during the “long idle time”. - Igor
- @igor is a question of performance and standard, there is a period of time in which requests do not come to the server, which is enough to close it. The rest of the time he does not stand idle. The connection I am talking about is a connection to a MySQL database. - Clool Mear pm
|