How to handle exception in releaseConenction(String tenantIdentifier, Connection connetcion) method which implements MultiTenantConnectionProvider. How do we ensure the connetcion will be closed if there is any exceptionin this method.
@Override
public void releaseConenction(String tenantIdentifier, Connection connetcion){
Statement st = connection.createStatement();
statement.execute(" ALTER SESSION SET CURRENT_SCHEMA="default");
connection.close()
}
}
I am seeing lots of connection close errors in logs.