public Tracking(String typeName) { this.typeName = typeName; this.createTrace = new ResourceCreationLocation("This is where the " + typeName + " was allocated"); }
@Override public void close() { timerKey.stop(); try { stmt.close(); results.close(); hasBeenClosed = true; long elapsed = System.currentTimeMillis() - creationLocation.getCreatingThreadInfo().getTimestamp(); log.debug("Closed {} after {}ms", this, elapsed); } catch(SQLException sqlex) { log.error("Caught SQLException", sqlex); //$NON-NLS-1$ } }
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 close() { timerKey.stop(); try { stmt.close(); results.close(); hasBeenClosed = true; long elapsed = System.currentTimeMillis() - creationLocation.getCreatingThreadInfo().getTimestamp(); log.debug("Closed {} after {}ms", this, elapsed); } catch(SQLException sqlex) { log.error("Caught SQLException", sqlex); //$NON-NLS-1$ } }
final ResourceCreationLocation alrsCreationException = new ResourceCreationLocation("This is where the AgnosticLightResultSet wrapper was created"); //$NON-NLS-1$ PreparedStatementVisitor<AgnosticLightResultSet> preparedStatementVisitor = ps -> { final ResourceCreationLocation creationException = new ResourceCreationLocation("This is where the ResultsSet was created", alrsCreationException); //$NON-NLS-1$ final ResultSetVisitor<AgnosticLightResultSet> resultSetVisitor = rs -> { try {
public Tracking(String typeName) { this.typeName = typeName; this.createTrace = new ResourceCreationLocation("This is where the " + typeName + " was allocated"); }
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 ResourceCreationLocation alrsCreationException = new ResourceCreationLocation("This is where the AgnosticLightResultSet wrapper was created"); //$NON-NLS-1$ PreparedStatementVisitor<AgnosticLightResultSet> preparedStatementVisitor = ps -> { final ResourceCreationLocation creationException = new ResourceCreationLocation("This is where the ResultsSet was created", alrsCreationException); //$NON-NLS-1$ final ResultSetVisitor<AgnosticLightResultSet> resultSetVisitor = rs -> { try {