Commit 26ac5bcc authored by Andre Freyssinet's avatar Andre Freyssinet

Logging enhancements.

parent 47b8aad9
......@@ -484,7 +484,7 @@ public abstract class DBTransaction extends AbstractTransaction implements DBTra
// connection fails. We should set a boolean in the catch clause of connectDB and execute the
// dbLogCommit only if the connection is successful.
dbLogCommit(log);
lastexc = null;
lastexc = null;
completed = true;
} catch (SQLException sqle) {
lastexc = sqle;
......@@ -519,6 +519,7 @@ public abstract class DBTransaction extends AbstractTransaction implements DBTra
lastTry = System.currentTimeMillis();
connectDB();
createPreparedStatement();
logmon.log(BasicLevel.DEBUG, "DBTransaction, commit: DB connected");
} catch (IOException exc) {
logmon.log(BasicLevel.INFO, "DBTransaction, commit: cannot reconnect" + exc.getMessage());
}
......@@ -527,6 +528,11 @@ public abstract class DBTransaction extends AbstractTransaction implements DBTra
if (lastexc != null)
throw new IOException(lastexc.getMessage());
if (startRetry != 0) {
// There was a reconnection process in progress, logs a message to signify its end.
logmon.log(BasicLevel.WARN, "DBTransaction, commit: reconnected");
}
// All operations are committed in database, frees them and clear the log.
log.forEach((k, op) -> { op.free(); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment