if (logSizeLimit == 0 || newSize < logSizeLimit) {
return;
}
int firstUncommittedSection = log.getLogSectionId();
Session[] sessions = database.getSessions(true);
Session oldestSession = null;
for (Session s : sessions) {
int firstUncommitted = s.getFirstUncommittedLog();
if (firstUncommitted != Session.LOG_WRITTEN) {
if (firstUncommitted < firstUncommittedSection) {
firstUncommittedSection = firstUncommitted;
oldestSession = s;
}
}
}
trace.info("Rolling back session #" +oldestSession.getId() + " (the oldest uncommitted)");
oldestSession.rollback();
logSizeBase = log.getSize();
}
}