The problem is that the connection does not close properly and gets stuck in sleep mode
In fact, it was only half.
The problem I ran into was that each application defined a new connection to the sever database. Therefore, every time I closed all connections, application A created a bunch of new connections in accordance with the WEB.xml configuration file and would work happily. Appendix B will do the same. The problem is that they are independent pools that try to capture to the limit defined by the server. I think this is a kind of race condition. Therefore, when application A finishes with connections, it sits waiting for them to be reused until the timeout expires, while application B, which requires a connection, now refuses resources, even though application A ended with and should return to the pool. Once the timeout has passed, the connection is freed, and B (or C, etc.) can receive it again.
eg. if the limit is 10 (mySQL profile limit), and each application is configured to use no more than 10, 20 connection attempts will be made. Obviously, this is a bad situation.
The solution is RTFM and put the connection information in the right place . This makes general publishing a pain, but there are ways around it (for example, linking to other xml files from context).
Just to be explicit: I put the connection details in WEB.xml for each application, and it had a fight.
source share