// Report on result set closed by driver instead of application
if (!calledExplicitly) {
this.eventSink
.consumeEvent(new ProfilerEvent(
ProfilerEvent.TYPE_WARN,
"",
(this.owningStatement == null) ? "N/A"
: this.owningStatement.currentCatalog,
this.connectionId,
(this.owningStatement == null) ? (-1)
: this.owningStatement.getId(),
this.resultId,
System.currentTimeMillis(),
0,
Constants.MILLIS_I18N,
null,
this.pointOfOrigin,
Messages
.getString("ResultSet.ResultSet_implicitly_closed_by_driver"))); //$NON-NLS-1$
}
if (this.rowData instanceof RowDataStatic) {
// Report on possibly too-large result sets
if (this.rowData.size() > this.connection
.getResultSetSizeThreshold()) {
this.eventSink
.consumeEvent(new ProfilerEvent(
ProfilerEvent.TYPE_WARN,
"",
(this.owningStatement == null) ? Messages
.getString("ResultSet.N/A_159")
: this.owningStatement.currentCatalog, //$NON-NLS-1$
this.connectionId,
(this.owningStatement == null) ? (-1)
: this.owningStatement.getId(),
this.resultId,
System.currentTimeMillis(),
0,
Constants.MILLIS_I18N,
null,
this.pointOfOrigin,
Messages
.getString(
"ResultSet.Too_Large_Result_Set",
new Object[] {
new Integer(
this.rowData
.size()),
new Integer(
this.connection
.getResultSetSizeThreshold()) })));
}
if (!isLast() && !isAfterLast() && (this.rowData.size() != 0)) {
this.eventSink
.consumeEvent(new ProfilerEvent(
ProfilerEvent.TYPE_WARN,
"",
(this.owningStatement == null) ? Messages
.getString("ResultSet.N/A_159")
: this.owningStatement.currentCatalog, //$NON-NLS-1$
this.connectionId,
(this.owningStatement == null) ? (-1)
: this.owningStatement.getId(),
this.resultId,
System.currentTimeMillis(),
0,
Constants.MILLIS_I18N,
null,
this.pointOfOrigin,
Messages
.getString(
"ResultSet.Possible_incomplete_traversal_of_result_set", //$NON-NLS-1$
new Object[] {
new Integer(
getRow()),
new Integer(
this.rowData
.size()) })));
}
}
//
// Report on any columns that were selected but
// not referenced
//
if (this.columnUsed.length > 0 && !this.rowData.wasEmpty()) {
StringBuffer buf = new StringBuffer(
Messages
.getString("ResultSet.The_following_columns_were_never_referenced")); //$NON-NLS-1$
boolean issueWarn = false;
for (int i = 0; i < this.columnUsed.length; i++) {
if (!this.columnUsed[i]) {
if (!issueWarn) {
issueWarn = true;
} else {
buf.append(", ");
}
buf.append(this.fields[i].getFullName());
}
}
if (issueWarn) {
this.eventSink.consumeEvent(new ProfilerEvent(
ProfilerEvent.TYPE_WARN, "",
(this.owningStatement == null) ? "N/A"
: this.owningStatement.currentCatalog,
this.connectionId,
(this.owningStatement == null) ? (-1)