HHH-13695 DDL export forgets to close a Statement

This commit is contained in:
Sanne Grinovero 2019-10-25 14:52:31 +01:00
parent e5539cc36c
commit b4a8052a15
1 changed files with 9 additions and 0 deletions

View File

@ -86,6 +86,15 @@ public class GenerationTargetToDatabase implements GenerationTarget {
@Override
public void release() {
if ( jdbcStatement != null ) {
try {
jdbcStatement.close();
jdbcStatement = null;
}
catch (SQLException e) {
throw ddlTransactionIsolator.getJdbcContext().getSqlExceptionHelper().convert( e, "Unable to close JDBC Statement after DDL execution" );
}
}
if ( releaseAfterUse ) {
ddlTransactionIsolator.release();
}