Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Driver e tomcat do Oracle UCP:encadeamentos não param


Eu tive o mesmo problema e consegui corrigir isso adicionando o seguinte código no meu ServletContextListener :
import oracle.ucp.admin.UniversalConnectionPoolManager;
import oracle.ucp.admin.UniversalConnectionPoolManagerImpl;

public class MyContextListener implements ServletContextListener {
    /* ... */

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        // Your shutdown sequence here
        /* ... */

        // Shutdown UCP if present, to avoid warnings about thread leaks
        UniversalConnectionPoolManager ucpManager = UniversalConnectionPoolManagerImpl.getUniversalConnectionPoolManager();
        if (ucpManager != null) {
            String[] poolNames = ucpManager.getConnectionPoolNames();
            if (poolNames != null) {
                for (String poolName : poolNames) {
                    ucpManager.destroyConnectionPool(poolName);
                }
            }
        }
    }

}