Integrate merge request feedback

This commit is contained in:
Sebastian Kürten
2021-04-12 12:23:15 +02:00
parent ce47bfe018
commit 64f682146d
4 changed files with 37 additions and 34 deletions

View File

@@ -89,7 +89,6 @@ class H2Database extends JdbcDatabase {
c = createConnection();
super.closeAllConnections();
setDirty(c, false);
c.commit();
c.close();
} catch (SQLException e) {
tryToClose(c, LOG, WARNING);

View File

@@ -82,7 +82,6 @@ class HyperSqlDatabase extends JdbcDatabase {
super.closeAllConnections();
c = createConnection();
setDirty(c, false);
c.commit();
s = c.createStatement();
s.executeQuery("SHUTDOWN");
s.close();

View File

@@ -355,13 +355,13 @@ abstract class JdbcDatabase implements Database<Connection> {
@GuardedBy("connectionsLock")
private boolean closed = false;
private boolean wasDirtyOnInitialisation = false;
private volatile boolean wasDirtyOnInitialisation = false;
protected abstract Connection createConnection()
throws DbException, SQLException;
// Used exclusively during open to compact the database after schema
// migrations and after DatabaseConstants#MAX_COMPACTION_INTERVAL_MS has
// migrations or after DatabaseConstants#MAX_COMPACTION_INTERVAL_MS has
// elapsed
protected abstract void compactAndClose() throws DbException;