Skip to content

Commit 06d90d1

Browse files
committed
1 parent c8fff38 commit 06d90d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/apache/ibatis/executor/BatchExecutor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,17 @@ public int doUpdate(MappedStatement ms, Object parameterObject)
5353

5454
public List doQuery(MappedStatement ms, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler)
5555
throws SQLException {
56+
Statement stmt = null;
5657
try {
5758
flushStatements();
5859
Configuration configuration = ms.getConfiguration();
5960
StatementHandler handler = configuration.newStatementHandler(this, ms, parameterObject, rowBounds, resultHandler);
6061
Connection connection = transaction.getConnection();
61-
Statement stmt = handler.prepare(connection);
62+
stmt = handler.prepare(connection);
6263
handler.parameterize(stmt);
6364
return handler.query(stmt, resultHandler);
6465
} finally {
65-
flushStatements();
66+
closeStatement(stmt);
6667
}
6768
}
6869

0 commit comments

Comments
 (0)