HHH-13695 DDL export forgets to close a Statement

(cherry picked from commit b4a8052a15)
This commit is contained in:
Sanne Grinovero 2019-10-25 14:52:31 +01:00 committed by Gail Badner
parent 0e43942b77
commit f35229d19a
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();
}