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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to