Statement-Leak in Mybatis

Description

The jboss As 5.1 datasource proxy is complaining about unclosed statements:

2011-06-29 17:57:23,557 WARN
[org.jboss.resource.adapter.jdbc.WrappedConnection]
(JobAcquisitionThread) Closing a result set you left open! Please close it yourself.
java.lang.Throwable: STACKTRACE
at
org.jboss.resource.adapter.jdbc.WrappedStatement.registerResultSet(WrappedStatement.java:909)
at
org.jboss.resource.adapter.jdbc.WrappedStatement.getResultSet(WrappedStatement.java:521)
at
org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:94)
at
org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:40)
at
org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55)
at
org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41)
at
org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:216)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:95)
at
org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:75)
at
org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:181)
at
org.activiti.engine.impl.persistence.entity.JobManager.findUnlockedTimersByDuedate(JobManager.java:103)
at
org.activiti.engine.impl.jobexecutor.GetUnlockedTimersByDuedateCmd.execute(GetUnlockedTimersByDuedateCmd.java:40)
at
org.activiti.engine.impl.jobexecutor.GetUnlockedTimersByDuedateCmd.execute(GetUnlockedTimersByDuedateCmd.java:29)
at
org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at
org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at
org.activiti.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:59)
at
org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at
org.activiti.engine.impl.jobexecutor.JobAcquisitionThread.run(JobAcquisitionThread.java:78)

You see this if you set
<track-statements>true</track-statements>
in the datasource definition.

Either this is a bug in Mybatis or we are not using it correctly. I tried to use mybatis-3.0.5, which sems to solve the problem, however the testsuite does not run with that version.
So maybe upgrading is an option but would require some work.

Environment

jboss5.1, mysql 5.0.8.4

Assignee

Unassigned

Reporter

Daniel Meyer (camunda)

Labels

None

Fix versions

Affects versions

Priority

Major
Configure