final int it_latch_count = 13;
//
// intermediate holders
Session[] sessions;
Session s;
Object[] row;
// Initialisation
sessions = database.sessionManager.getVisibleSessions(session);
// Do it.
for (int i = 0; i < sessions.length; i++) {
if (sessions[i].isClosed()) {
continue;
}
s = sessions[i];
row = t.getEmptyRowData();
row[isid] = ValuePool.getLong(s.getId());
row[ict] = new TimestampData(s.getConnectTime() / 1000);
row[iuname] = s.getUsername();
row[iis_admin] = ValuePool.getBoolean(s.isAdmin());
row[iautocmt] = s.sessionContext.isAutoCommit;
row[ireadonly] = s.isReadOnlyDefault;
Number lastId = s.getLastIdentity();
if (lastId != null) {
row[ilast_id] = ValuePool.getLong(lastId.longValue());
}
row[it_tx] = Boolean.valueOf(s.isInMidTransaction());
row[it_size] = ValuePool.getLong(s.getTransactionSize());
HsqlName name = s.getCurrentSchemaHsqlName();
if (name != null) {
row[it_schema] = name.name;
}