tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Guay-Paquet <ber...@step.polymtl.ca>
Subject Re: Tomcat jdbc-pool not closing statements
Date Tue, 19 Mar 2013 20:23:29 GMT
> Can you post some example of your code? Can you also post your pool's
> configuration?
Here is my configuration from tomee.xml. I'm not 100% sure how it maps 
to Tomcat values though.
<Resource id="jdbc/my-db" type="javax.sql.DataSource">
   JdbcDriver=com.mysql.jdbc.Driver
   JdbcUrl=jdbc:mysql://localhost:3306/DBNAME
   UserName=....
   Password=....
   JtaManaged=true
ConnectionProperties=characterEncoding=UTF-8;useLegacyDatetimeCode=false
   initialSize=10
   maxActive=100
   maxIdle=30
   validationQuery=/* ping */
   testOnBorrow=true
   testWhileIdle=true
   timeBetweenEvictionRunsMillis=10000
   minEvictableIdleTimeMillis=60000
</Resource>

Adding "DataSourceCreator=dbcp" to the configuration stops the leak 
without any other change to my code. This option reverts the connection 
pooling of TomEE to commons-dbcp.

My code uses MyBatis 3.2.1 for the actual management of jdbc, so I'm not 
sure which information would help. I use a mapper and I can guarantee 
that sqlSession.close() is called which in turn calls 
Connection#close(). The code which closes Statements is inside MyBatis.

Let me know if you need more information.

Regards,
Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message