dont close dbenv when application is shut down
since this caused segfault or something when the app was restarted.
This commit is contained in:
parent
ff622ca10e
commit
26cf1c70af
1 changed files with 8 additions and 1 deletions
|
@ -24,9 +24,13 @@ public class DbWrapper {
|
||||||
volatile long txncount=0;
|
volatile long txncount=0;
|
||||||
|
|
||||||
private File dbBaseDir;
|
private File dbBaseDir;
|
||||||
|
private String dbHome;
|
||||||
|
|
||||||
public DbWrapper (String dbHome, String dbFilename, boolean useTx) throws DbException {
|
public DbWrapper (String dbHome, String dbFilename, boolean useTx) throws DbException {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
this.dbHome = dbHome;
|
||||||
dbBaseDir = new File (dbHome);
|
dbBaseDir = new File (dbHome);
|
||||||
if (!dbBaseDir.exists())
|
if (!dbBaseDir.exists())
|
||||||
dbBaseDir.mkdirs();
|
dbBaseDir.mkdirs();
|
||||||
|
@ -82,7 +86,10 @@ public class DbWrapper {
|
||||||
public void shutdown () throws DbException {
|
public void shutdown () throws DbException {
|
||||||
if (loaded) {
|
if (loaded) {
|
||||||
db.close (0);
|
db.close (0);
|
||||||
dbenv.close (0);
|
// closing the dbenv leads to segfault when app is restarted
|
||||||
|
// dbenv.close (0);
|
||||||
|
// dbenv.remove (dbHome, Db.DB_FORCE);
|
||||||
|
Server.getLogger ().log ("Closed Berkeley DB");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue