@Override public void jdbcConnectionReleaseEnd() { for ( ConnectionObserver observer : observers ) { observer.physicalConnectionReleased(); } }
@Override public void jdbcConnectionAcquisitionEnd(Connection connection) { for ( ConnectionObserver observer : observers ) { observer.physicalConnectionObtained( connection ); } }
private PreparedStatement buildBatchStatement(String sql, boolean callable) { return jdbcCoordinator.getStatementPreparer().prepareStatement( sql, callable ); }
@Override public JDBCException convert(SQLException e, String message) { return sharedSessionContract.getJdbcServices().getSqlExceptionHelper().convert( e, message ); }
@Override public void execute(Connection connection) throws SQLException { Statement stmt = ((SessionImplementor)s).getJdbcCoordinator().getStatementPreparer().createStatement(); ((SessionImplementor)s).getJdbcCoordinator().getResultSetReturn().executeUpdate( stmt, "DROP FUNCTION spLock FROM TestInterSystemsFunctionsClass" ); } }
@Override public SqlExceptionHelper getSqlExceptionHelper() { return jdbcServices.getSqlExceptionHelper(); }
/** * Convert an SQLException using the current converter, doing some logging first. * * @param sqlException The exception to convert * @param message An error message. * * @return The converted exception */ public JDBCException convert(SQLException sqlException, String message) { return convert( sqlException, message, "n/a" ); }
@Override public SqlStatementLogger getSqlStatementLogger() { return jdbcServices.getSqlStatementLogger(); }
/** * Determine whether the given Session is (still) physically connected * to the database, that is, holds an active JDBC Connection internally. * @param session the Hibernate Session to check * @see #isSameConnectionForEntireSession(Session) */ protected boolean isPhysicallyConnected(Session session) { if (!(session instanceof SessionImplementor)) { // The best we can do is to check whether we're logically connected. return session.isConnected(); } return ((SessionImplementor) session).getJdbcCoordinator().getLogicalConnection().isPhysicallyConnected(); }
private ResourceRegistry getResourceRegistry(JdbcCoordinator jdbcCoord) { return jdbcCoord.getResourceRegistry(); } }
/** * Standard (legacy) behavior for logging warnings associated with a JDBC {@link Connection} and clearing them. * <p/> * Calls {@link #handleAndClearWarnings(Connection, WarningHandler)} using {@link #STANDARD_WARNING_HANDLER} * * @param connection The JDBC connection potentially containing warnings */ public void logAndClearWarnings(Connection connection) { handleAndClearWarnings( connection, STANDARD_WARNING_HANDLER ); }
protected void abortBatch() { jdbcCoordinator.abortBatch(); }
@Override public TypeInfo getTypeInfoForJdbcCode(int jdbcTypeCode) { for ( TypeInfo typeInfo : typeInfoSet ) { if ( typeInfo.getJdbcTypeCode() == jdbcTypeCode ) { return typeInfo; } } return null; }
@Override protected PreparedStatement prepare(String insertSQL, SharedSessionContractImplementor session) throws SQLException { return session .getJdbcCoordinator() .getStatementPreparer() .prepareStatement( insertSQL, keyColumns ); } }
protected JDBCException convert(SQLException e, String message) { return context.getSession().getJdbcServices().getSqlExceptionHelper().convert( e, message, context.getSql() ); }
@Override public SqlExceptionHelper getSqlExceptionHelper() { return jdbcServices.getSqlExceptionHelper(); }
@Override public SqlStatementLogger getSqlStatementLogger() { return jdbcServices.getSqlStatementLogger(); }
@Override protected PreparedStatement prepare(String insertSQL, SharedSessionContractImplementor session) throws SQLException { return session .getJdbcCoordinator() .getStatementPreparer() .prepareStatement( insertSQL, PreparedStatement.RETURN_GENERATED_KEYS ); }
@Override protected PreparedStatement prepare(String insertSQL, SharedSessionContractImplementor session) throws SQLException { return session .getJdbcCoordinator() .getStatementPreparer() .prepareStatement( insertSQL, PreparedStatement.NO_GENERATED_KEYS ); }
@Override protected PreparedStatement prepare(String insertSQL, SharedSessionContractImplementor session) throws SQLException { return session.getJdbcCoordinator().getStatementPreparer().prepareStatement( insertSQL, keyColumns ); }