@Override public void finalize() throws Throwable { try { if (!hasBeenClosed) { close(); AssertUtils.assertAndLogWithException(log, false, String.format( "This AgnosticLightResultSet is being finalized, but it has not been closed. " + //$NON-NLS-1$ "This is a programming error and can lead to cursor leaks. Thread: %s", creationThreadName), //$NON-NLS-1$ creationLocation); } } finally { super.finalize(); } }
public AgnosticLightResultSet fromResultSet(PreparedStatement preparedStatement, ResultSet resultSet, DBType dbType, String queryString) { FinalSQLString sqlString = SQLString.getUnregisteredQuery(queryString); String timingModule = "visitResultSet"; ResultSetMetaData metaData = ResultSets.getMetaData(resultSet); SqlTimer sqlTimer = getSqlTimer(); ResourceCreationLocation creationException = new ResourceCreationLocation("This is where the ResultsSet was created"); //$NON-NLS-1$ return new AgnosticLightResultSetImpl( resultSet, dbType, metaData, preparedStatement, timingModule, sqlString, sqlTimer, creationException); } }
final ResultSetVisitor<AgnosticLightResultSet> resultSetVisitor = rs -> { try { return new AgnosticLightResultSetImpl( rs, dbType,
@Override public void visitAndClose(Visitor<? super AgnosticLightResultRow> visitor) throws PalantirSqlException { try { for (AgnosticLightResultRow row : this) { visitor.visit(row); } } finally { try { close(); } catch (RuntimeException e) { log.warn("Error while closing visitor", e); } } } }
public AgnosticLightResultSet fromResultSet(PreparedStatement preparedStatement, ResultSet resultSet, DBType dbType, String queryString) { FinalSQLString sqlString = SQLString.getUnregisteredQuery(queryString); String timingModule = "visitResultSet"; ResultSetMetaData metaData = ResultSets.getMetaData(resultSet); SqlTimer sqlTimer = getSqlTimer(); ResourceCreationLocation creationException = new ResourceCreationLocation("This is where the ResultsSet was created"); //$NON-NLS-1$ return new AgnosticLightResultSetImpl( resultSet, dbType, metaData, preparedStatement, timingModule, sqlString, sqlTimer, creationException); } }
@Override public void finalize() throws Throwable { try { if (!hasBeenClosed) { close(); AssertUtils.assertAndLogWithException(log, false, String.format( "This AgnosticLightResultSet is being finalized, but it has not been closed. " + //$NON-NLS-1$ "This is a programming error and can lead to cursor leaks. Thread: %s", creationThreadName), //$NON-NLS-1$ creationLocation); } } finally { super.finalize(); } }
final ResultSetVisitor<AgnosticLightResultSet> resultSetVisitor = rs -> { try { return new AgnosticLightResultSetImpl( rs, dbType,
@Override public void visitAndClose(Visitor<? super AgnosticLightResultRow> visitor) throws PalantirSqlException { try { for (AgnosticLightResultRow row : this) { visitor.visit(row); } } finally { try { close(); } catch (RuntimeException e) { log.warn("Error while closing visitor", e); } } } }