private void explicitClose(Statement proxy) { if ( isValid() ) { LogicalConnectionImplementor lc = getConnectionProxy().getLogicalConnection(); getResourceRegistry().release( proxy ); lc.afterStatementExecution(); } }
private void explicitClose(Statement proxy) { if ( isValid() ) { LogicalConnectionImplementor lc = getConnectionProxy().getLogicalConnection(); getResourceRegistry().release( proxy ); lc.afterStatementExecution(); } }
@Override public <T> T coordinateWork(WorkExecutorVisitable<T> work) { Connection connection = getLogicalConnection().getDistinctConnectionProxy(); try { T result = work.accept( new WorkExecutor<T>(), connection ); getLogicalConnection().afterStatementExecution(); return result; } catch ( SQLException e ) { throw sqlExceptionHelper().convert( e, "error executing work" ); } finally { try { if ( ! connection.isClosed() ) { connection.close(); } } catch (SQLException e) { LOG.debug( "Error closing connection proxy", e ); } } }
@Override public <T> T coordinateWork(WorkExecutorVisitable<T> work) { Connection connection = getLogicalConnection().getDistinctConnectionProxy(); try { T result = work.accept( new WorkExecutor<T>(), connection ); getLogicalConnection().afterStatementExecution(); return result; } catch ( SQLException e ) { throw sqlExceptionHelper().convert( e, "error executing work" ); } finally { try { if ( ! connection.isClosed() ) { connection.close(); } } catch (SQLException e) { LOG.debug( "Error closing connection proxy", e ); } } }
.getJdbcCoordinator() .getLogicalConnection() .afterStatementExecution();
.getJdbcCoordinator() .getLogicalConnection() .afterStatementExecution();
protected void createTemporaryTableIfNecessary(final Queryable persister, final SessionImplementor session) { // Don't really know all the codes required to adequately decipher returned jdbc exceptions here. // simply allow the failure to be eaten and the subsequent insert-selects/deletes should fail TemporaryTableCreationWork work = new TemporaryTableCreationWork( persister ); if ( shouldIsolateTemporaryTableDDL() ) { session.getTransactionCoordinator() .getTransaction() .createIsolationDelegate() .delegateWork( work, getFactory().getSettings().isDataDefinitionInTransactionSupported() ); } else { final Connection connection = session.getTransactionCoordinator() .getJdbcCoordinator() .getLogicalConnection() .getShareableConnectionProxy(); work.execute( connection ); session.getTransactionCoordinator() .getJdbcCoordinator() .getLogicalConnection() .afterStatementExecution(); } }
protected void createTemporaryTableIfNecessary(final Queryable persister, final SessionImplementor session) { // Don't really know all the codes required to adequately decipher returned jdbc exceptions here. // simply allow the failure to be eaten and the subsequent insert-selects/deletes should fail TemporaryTableCreationWork work = new TemporaryTableCreationWork( persister ); if ( shouldIsolateTemporaryTableDDL() ) { session.getTransactionCoordinator() .getTransaction() .createIsolationDelegate() .delegateWork( work, getFactory().getSettings().isDataDefinitionInTransactionSupported() ); } else { final Connection connection = session.getTransactionCoordinator() .getJdbcCoordinator() .getLogicalConnection() .getShareableConnectionProxy(); work.execute( connection ); session.getTransactionCoordinator() .getJdbcCoordinator() .getLogicalConnection() .afterStatementExecution(); } }