What are abandoned connections? What will happen if I will set removeAbandoned = false?
Thank You!
Abandoned connections are the connection used by application to do some task but application missed to close them or there was some exception in the process that they weren't closed.
Setting removeAbandoned = false
might result in out of connections error because there are so many connections in abandoned state then your application will run out of connection. There won't be any connection available to perform the task.
Setting removeAbandoned = true
will close the connection after the time limit set for removeAbandonedTimeout
.
This issue arises because of connection leaks in the application.
As per Tomcat page:
(boolean) Flag to remove abandoned connections if they exceed the removeAbandonedTimeout. If set to true a connection is considered abandoned and eligible for removal if it has been in use longer than the removeAbandonedTimeout Setting this to true can recover db connections from applications that fail to close a connection. See also logAbandoned The default value is false.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With