Are you talking about parallel deployment or connection pools ?

Parallel deployment is in Tomcat since Tomcat 7

Gilles

-----Message d'origine-----
De : HeeGu Lee [mailto:elfhazardw...@gmail.com] 
Envoyé : mercredi 21 novembre 2018 13:24
À : Tomcat Users List
Objet : Re: Connection pool and parallel deployment problem

I think it is good for your mental health not to use this feature.
You just have to think of it as an experimental function like google
chrome's about://flags.

JMX has subscribe model.
However, Tomcat is no ability to receive notifications.
And most JDBC implementations are not interested in such features.
Both Tomcat and DB vendors are not going to fix it.

It's not a tragedy, it's just a comedy.


2018년 11월 21일 (수) 오후 8:00, Gilles SCHLIENGER <gilles.schlien...@cncc.fr>님이
작성:

> Hi all,
>
> We are using Tomcat 9 and parallel deployment.
>
> I use a connection pool defined in the xml context (myApp##1.xml,
> myApp##2.xml in my exemple)
>
> I have the following problem :
> - I have myApp##1.war deployed using a connection pool (configured in
> myApp##1.xml)
> - I deploy myApp##2.war (using a connection pool defined in myApp##2.xml)
> - when the last session in myApp##1 expires, myApp##1 is automatically
> undeployed (I have undeployOldVersions="true" in server.xml for the Host)
> but the connections opened by myApp##1 are not closed.
>
> I used the Tomcat configuration from the example in :
>
> https://tomcat.apache.org/tomcat-9.0-doc/jndi-datasource-examples-howto.html#Database_Connection_Pool_(DBCP_2)_Configurations
>
> <Resource name="jdbc/integrationGG" auth="Container"
> type="javax.sql.DataSource"
>                maxTotal="100" maxIdle="30" maxWaitMillis="10000"
> destroy-method="close"
>                username="postgres" password="password"
> driverClassName="org.postgresql.Driver"
>
>  url="jdbc:postgresql://localhost:5432/postgres?stringtype=unspecified"/>
>
> During undeploy, I get the following messages :
>
> 21-Nov-2018 11:42:54.795 AVERTISSEMENT
> [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The
> web application [myApp##1] registered the JDBC driver
> [org.postgresql.Driver] but failed to unregister it when the web
> application was stopped. To prevent a memory leak, the JDBC Driver has been
> forcibly unregistered.
>
> ...
>
> 21-Nov-2018 11:42:54.800 AVERTISSEMENT
> [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The
> web application [myApp##1] appears to have started a thread named
> [Abandoned connection cleanup thread] but has failed to stop it. This is
> very likely to create a memory leak. Stack trace of thread:
> java.base@10.0.1/java.lang.Object.wait(Native Method)
> java.base@10.0.1
> /java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
>
> com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:64)
> java.base@10.0.1
> /java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
> java.base@10.0.1
> /java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
> java.base@10.0.1/java.lang.Thread.run(Thread.java:844)
>
> I have tested adding < destroy-method=close > but it did not change
> anything
>
> Is this a bug ?
>
> Thanks for any help !
>
> Regards
> Gilles
>
>

Reply via email to