[FIX] some open close corrections
This commit is contained in:
parent
1713e20252
commit
30ef425d75
@ -31,6 +31,7 @@ public class DbIoFactory {
|
||||
}
|
||||
final DbIo dbIo = createInstance(config);
|
||||
if (config.getKeepConnected()) {
|
||||
dbIo.open();
|
||||
dbIoStored.add(dbIo);
|
||||
}
|
||||
dbIo.open();
|
||||
|
@ -26,10 +26,6 @@ public class DbIoMorphia extends DbIo implements Closeable {
|
||||
|
||||
public DbIoMorphia(final DbConfig config) throws IOException {
|
||||
super(config);
|
||||
// If we want to stay connected, we instantiate a basic connection (only force close can remove it).
|
||||
if (this.config.getKeepConnected()) {
|
||||
open();
|
||||
}
|
||||
}
|
||||
|
||||
public Datastore getDatastore() {
|
||||
|
@ -15,10 +15,6 @@ public class DbIoSql extends DbIo {
|
||||
|
||||
public DbIoSql(final DbConfig config) throws IOException {
|
||||
super(config);
|
||||
// If we want to stay connected, we instantiate a basic connection (only force close can remove it).
|
||||
if (this.config.getKeepConnected()) {
|
||||
open();
|
||||
}
|
||||
}
|
||||
|
||||
public Connection getConnection() {
|
||||
|
@ -122,14 +122,15 @@ public class ConfigureDb {
|
||||
da.deleteDB(ConfigBaseVariable.bdDatabase);
|
||||
} else if ("MONGO".equalsIgnoreCase(modeTest)) {
|
||||
da.deleteDB(ConfigBaseVariable.bdDatabase);
|
||||
} else {}
|
||||
}
|
||||
}
|
||||
|
||||
public static void clear() throws IOException {
|
||||
LOGGER.info("Remove the test db");
|
||||
removeDB();
|
||||
// The connection is by default open ==> close it at the end of test:
|
||||
da.close();
|
||||
DbIoFactory.closeAllForceMode();
|
||||
ConfigBaseVariable.clearAllValue();
|
||||
da.close();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user