Java – is there a way to free the saturated connection pool?

I use open ESB on the GlassFish server

We receive this error every few days: an error occurred while assigning a connection Reason: the connection in use is equal to the maximum pool size and the maximum waiting time for expiration Unable to assign more connections

The best way to alleviate CP is to restart the server We also managed to set up another CP

My question is: is there any way to actively "tell" CP to release all open connections?

Cheers, Ilan

Solution

Before that, find out the reason why the connection is not released correctly It sounds like a place will be forgotten (do you have all close() in the finally clause?)

I strongly recommend Michael nygards "release it!" Technology used to prepare software for production

Edit #1: if I correctly understand your description, your backend program entering the msgw in qsysopr will cause the connection to hang until a response is given, which is close to forever in your case Can you choose to use a profile with a default Reply of "C", which allows faults to be propagated to you as exceptions?

Otherwise, you can set a 24-hour timeout for the connection or the entire server? Then at least the connection will eventually close Although the solution cannot be extended, it can make development easier

Please note that there can also be a separate monitoring thread that periodically looks up the msgw and automatically sends them answers for post analysis after fetching the call stack

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>