emacarron / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

BatchExecutor doQuery will not close open statements #138

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the MyBatis are you using?

3.02
Please describe the problem.  Unit tests are best!
When query oracle using batchexecutor, a reach the maxim number of cursors 
error has been reported. 

What is the expected output? What do you see instead?
public List doQuery(MappedStatement ms, Object parameterObject, RowBounds 
rowBounds, ResultHandler resultHandler)
      throws SQLException {
    flushStatements();
    Configuration configuration = ms.getConfiguration();
    StatementHandler handler = configuration.newStatementHandler(this, ms, parameterObject, rowBounds, resultHandler);
    Connection connection = transaction.getConnection();
    Statement stmt = handler.prepare(connection);
    handler.parameterize(stmt);
    return handler.query(stmt, resultHandler); <===== no statement will be closed if not commit
  }

Please provide any additional information below.

Original issue reported on code.google.com by qch1...@gmail.com on 11 Oct 2010 at 9:47

GoogleCodeExporter commented 9 years ago
I have updated the above method to add a flushStatements() call after the query

Original comment by nathan.m...@gmail.com on 2 Nov 2010 at 3:33