Storage is removed from the list in case of abnormal initialization
@@ -270,8 +270,20 @@ public class OrientDBEmbedded implements OrientDBInternal {
checkOpen();
config = solveConfig(config);
OAbstractPaginatedStorage storage = getOrInitStorage(name);
+ // THIS OPEN THE STORAGE ONLY THE FIRST TIME
+ try {
// THIS OPEN THE STORAGE ONLY THE FIRST TIME
storage.open(config.getConfigurations());
+ } catch (RuntimeException e) {
+ if (storage != null) {
+ storages.remove(storage.getName());
+ } else {
+ storages.remove(name);
+ }
+
+ throw e;
+ }
+
embedded = newSessionInstance(storage);
embedded.init(config, getOrCreateSharedContext(storage));
}
