HHH-17887 Release mode After Statment with deferred result set access does not work
This commit is contained in:
parent
189de9dab7
commit
e95eaf6cb3
|
@ -182,6 +182,8 @@ public class OutputsImpl implements Outputs {
|
|||
executionContext
|
||||
);
|
||||
|
||||
try {
|
||||
|
||||
//noinspection unchecked
|
||||
final RowReader<Object> rowReader = (RowReader<Object>) ResultsHelper.createRowReader(
|
||||
executionContext,
|
||||
|
@ -250,6 +252,9 @@ public class OutputsImpl implements Outputs {
|
|||
finally {
|
||||
rowReader.finishUp( jdbcValuesSourceProcessingState );
|
||||
jdbcValuesSourceProcessingState.finishUp( results.size() > 1 );
|
||||
}
|
||||
}
|
||||
finally {
|
||||
jdbcValues.finishUp( this.context.getSession() );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -253,7 +253,6 @@ public class DeferredResultSetAccess extends AbstractResultSetAccess {
|
|||
|
||||
skipRows( resultSet );
|
||||
logicalConnection.getResourceRegistry().register( resultSet, preparedStatement );
|
||||
|
||||
}
|
||||
catch (SQLException e) {
|
||||
try {
|
||||
|
@ -267,9 +266,6 @@ public class DeferredResultSetAccess extends AbstractResultSetAccess {
|
|||
"JDBC exception executing SQL [" + finalSql + "]"
|
||||
);
|
||||
}
|
||||
finally {
|
||||
logicalConnection.afterStatement();
|
||||
}
|
||||
}
|
||||
|
||||
private JdbcSessionContext context() {
|
||||
|
@ -324,20 +320,18 @@ public class DeferredResultSetAccess extends AbstractResultSetAccess {
|
|||
|
||||
@Override
|
||||
public void release() {
|
||||
final LogicalConnectionImplementor logicalConnection = getPersistenceContext().getJdbcCoordinator()
|
||||
.getLogicalConnection();
|
||||
if ( resultSet != null ) {
|
||||
getPersistenceContext().getJdbcCoordinator()
|
||||
.getLogicalConnection()
|
||||
.getResourceRegistry()
|
||||
.release( resultSet, preparedStatement );
|
||||
logicalConnection.getResourceRegistry().release( resultSet, preparedStatement );
|
||||
resultSet = null;
|
||||
}
|
||||
|
||||
if ( preparedStatement != null ) {
|
||||
getPersistenceContext().getJdbcCoordinator()
|
||||
.getLogicalConnection()
|
||||
.getResourceRegistry()
|
||||
.release( preparedStatement );
|
||||
logicalConnection.getResourceRegistry().release( preparedStatement );
|
||||
preparedStatement = null;
|
||||
}
|
||||
|
||||
logicalConnection.afterStatement();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue