public void release() { JDBCExceptionReporter.logAndClearWarnings(connection); connection = null; } }
public void release() throws SQLException { JDBCExceptionReporter.logAndClearWarnings( connection ); if ( toggleAutoCommit ) { connection.setAutoCommit( false ); } connection = null; } }
public void release() throws SQLException { // we only release the connection if ( connection != null ) { JDBCExceptionReporter.logAndClearWarnings( connection ); if ( toggleAutoCommit ) { connection.setAutoCommit( false ); } provider.closeConnection( connection ); connection = null; } } }
public void release() throws SQLException { if ( connection!=null ) { JDBCExceptionReporter.logAndClearWarnings(connection); connectionProvider.closeConnection( connection ); connectionProvider.close(); } connection = null; } }
private static List<SQLException> executeScript(final Connection connection, final String[] script) throws SQLException { List<SQLException> exceptions = Collections.emptyList(); final Statement statement = connection.createStatement(); try { for (final String line : script) { if (LOG.isLoggable(Level.FINE)) { LOG.fine(line); } try { statement.executeUpdate(line); if (statement.getWarnings() != null) { JDBCExceptionReporter.logAndClearWarnings(connection); } } catch (final SQLException e) { if (exceptions.isEmpty()) { exceptions = new ArrayList<SQLException>(); } exceptions.add(e); } } } finally { statement.close(); } return exceptions; }
private static List<SQLException> executeScript(Connection connection, String[] script) throws SQLException { List<SQLException> exceptions = Collections.emptyList(); Statement statement = connection.createStatement(); try { for (String line : script) { LOG.debug(line); try { statement.executeUpdate(line); if (statement.getWarnings() != null) { JDBCExceptionReporter.logAndClearWarnings(connection); } } catch (SQLException e) { if (exceptions.isEmpty()) { exceptions = new ArrayList<SQLException>(); } exceptions.add(e); } } } finally { statement.close(); } return exceptions; }
private static List<SQLException> executeScript(Connection connection, String[] script) throws SQLException { List<SQLException> exceptions = Collections.emptyList(); Statement statement = connection.createStatement(); try { for (String line : script) { log.debug(line); try { statement.executeUpdate(line); if (statement.getWarnings() != null) { JDBCExceptionReporter.logAndClearWarnings(connection); } } catch (SQLException e) { if (exceptions.isEmpty()) { exceptions = new ArrayList<SQLException>(); } exceptions.add(e); } } } finally { statement.close(); } return exceptions; }
public void release() throws SQLException { if ( connection != null ) { try { JDBCExceptionReporter.logAndClearWarnings( connection ); connectionProvider.closeConnection( connection ); } finally { connectionProvider.close(); } } connection = null; } }
private void closeConnection(Connection connection) { if (connectionProvider != null) { try { if (connection != null) { JDBCExceptionReporter.logAndClearWarnings(connection); connectionProvider.closeConnection(connection); } } catch (SQLException e) { exceptions.add(e); JDBCExceptionReporter.logExceptions(e); } finally { connectionProvider.close(); connectionProvider = null; } } }
/** * Physically closes the JDBC Connection. */ private void closeConnection() { if ( log.isDebugEnabled() ) { log.debug( "closing JDBC connection [" + batcher.openResourceStatsAsString() + "]" ); } try { if ( !connection.isClosed() ) { JDBCExceptionReporter.logAndClearWarnings( connection ); } factory.getConnectionProvider().closeConnection( connection ); connection = null; } catch (SQLException sqle) { throw JDBCExceptionHelper.convert( factory.getSQLExceptionConverter(), sqle, "Cannot close connection" ); } }
/** * Physically closes the JDBC Connection. */ private void closeConnection() { if ( log.isDebugEnabled() ) { log.debug( "releasing JDBC connection [" + batcher.openResourceStatsAsString() + "]" ); } try { if ( !connection.isClosed() ) { JDBCExceptionReporter.logAndClearWarnings( connection ); } factory.getConnectionProvider().closeConnection( connection ); connection = null; } catch (SQLException sqle) { throw JDBCExceptionHelper.convert( factory.getSQLExceptionConverter(), sqle, "Cannot release connection" ); } }
public void closeConnection(Connection conn) throws HibernateException { if ( log.isDebugEnabled() ) { log.debug( "closing JDBC connection" + preparedStatementCountsToString() + resultSetCountsToString() ); } try { if ( !conn.isClosed() ) { JDBCExceptionReporter.logAndClearWarnings(conn); } factory.getConnectionProvider().closeConnection(conn); } catch (SQLException sqle) { throw JDBCExceptionHelper.convert( factory.getSQLExceptionConverter(), sqle, "Cannot close connection" ); } }
public void closeConnection(Connection conn) throws HibernateException { if ( log.isDebugEnabled() ) { log.debug( "closing JDBC connection" + preparedStatementCountsToString() + resultSetCountsToString() ); } try { if ( !conn.isClosed() ) { JDBCExceptionReporter.logAndClearWarnings(conn); } factory.getConnectionProvider().closeConnection(conn); } catch (SQLException sqle) { throw JDBCExceptionHelper.convert( factory.getSQLExceptionConverter(), sqle, "Cannot close connection" ); } }