Changes in database session context persists with pooled connection reuse
问题 In my application I have multithreads that needs to access database and I am using apache.tomcat.jdbc.pool.DataSource as a JDBC connection pool. In some cases users execute stored procedures that might affect the database session context/variables before executing another query to retrieve some data. After a thread is finished, connection is closed but the way the pooled connections work, the connection is not actually closed but rather returned to the connection pool for reuse. The problem