admin管理员组

文章数量:1123272

I am reading about uses of Connection Pool in Java based web applications.

.0-doc/jdbc-pool.html

I understand that a Connection in the Connection Pool is equivalent to a Session on the Database. I have a Spring Boot application that uses Oracle Database, and I am using a Connection Pool inside Tomcat to connect to the Database.

I wanted to ask.. What happens after Connection is released from the Connection pool? For example, in case of a traffic Surge, my Active Connection in the Connection pool can go up to 100, because maxActive is set to 100.. after the surge is over, my Connection pool will release many of these Connections.. During release process, will my Connection Pool also make a call to the Database to Close the Session associated with the Connection? Or the DB Sessions will be closed by the Database itself based on settings in Oracle?

I am reading about uses of Connection Pool in Java based web applications.

https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

I understand that a Connection in the Connection Pool is equivalent to a Session on the Database. I have a Spring Boot application that uses Oracle Database, and I am using a Connection Pool inside Tomcat to connect to the Database.

I wanted to ask.. What happens after Connection is released from the Connection pool? For example, in case of a traffic Surge, my Active Connection in the Connection pool can go up to 100, because maxActive is set to 100.. after the surge is over, my Connection pool will release many of these Connections.. During release process, will my Connection Pool also make a call to the Database to Close the Session associated with the Connection? Or the DB Sessions will be closed by the Database itself based on settings in Oracle?

Share Improve this question asked 9 hours ago KulKul 855 bronze badges 2
  • 1 This will be a function of your client, not anything that Oracle itself manages. I would be interested in knowing what solution is provided, as we've had issues with this from some applications as well. As a stop-gap measure, as a DBA I had to implement idle session killing in the database to keep down the session count. That is not a good model, so hopefully there's a way to maintain a proper client-side connection pool that reuses database connections between web calls. – Paul W Commented 9 hours ago
  • I am going to check on suggestion by @AlexPoole (below). I am suspecting, either some offline process are firing this, or transactions are in the open state.. – Kul Commented 5 hours ago
Add a comment  | 

1 Answer 1

Reset to default 1

All database resources associated with connection released automatically when connection is closed.

本文标签: javaDoes Connection pool also closes associated Session on the DatabaseStack Overflow