Database: проверка на доступность базы перед коммитом
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<name>Database</name>
|
||||
|
||||
<artifactId>database</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
<version>0.2-SNAPSHOT</version>
|
||||
<packaging>bundle</packaging>
|
||||
|
||||
<parent>
|
||||
|
||||
@@ -62,6 +62,7 @@ class Database implements IDatabase {
|
||||
private DB database;
|
||||
|
||||
AutosaveDBThread(DB db) {
|
||||
super("Autosave DB Thread");
|
||||
this.database = db;
|
||||
}
|
||||
|
||||
@@ -80,7 +81,9 @@ class Database implements IDatabase {
|
||||
} catch (InterruptedException ignore) {
|
||||
// ignore
|
||||
}
|
||||
database.commit();
|
||||
if (!database.isClosed()) {
|
||||
database.commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user