Permalink
Browse files

Must close the statement before closing the connection to prevent con…

…nection pool from doing the statement-close-job
  • Loading branch information...
1 parent 7ddb9ef commit fef2e87b0327f50d65ecab437e5b3727f644d6c3 @mbknor committed Jan 3, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/main/java/org/sql2o/Query.java
@@ -370,8 +370,8 @@ public Query addColumnMapping(String columnName, String propertyName){
private void closeConnectionIfNecessary(){
try{
if (!this.connection.getJdbcConnection().isClosed() && this.connection.getJdbcConnection().getAutoCommit() && statement != null){
- this.connection.getJdbcConnection().close();
statement.close();
+ this.connection.getJdbcConnection().close();
}
}
catch (Exception ex){

0 comments on commit fef2e87

Please sign in to comment.