javaoracle-databasejdbcdatabase-connectionconnection-pooling

Does Connection pool also closes associated Session on the Database?


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?


Solution

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