How to reset session context/variables in JDBC pooled connections - MySQL / Oracle 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.
Is there a way to enforce closing the connection instead of just returning it to pool. Or how can we clear/reset the connection session context/variables for MySQL or Oracle using a stored procedure.
DBMS_SESSION.CLEAR_ALL_CONTEXT

This procedure clears application context information in the specified
namespace.

DBMS_SESSION.RESET_PACKAGE

This procedure de-instantiates all packages in this session. It frees
the package state.