From c51098760d7d9bfe18bec29254a0249b8271600d Mon Sep 17 00:00:00 2001 From: lvca Date: Wed, 19 Jun 2013 11:36:12 +0200 Subject: [PATCH] Fixed bug on index closing --- .../orient/core/type/tree/OMVRBTreePersistent.java | 9 +++++++-- .../orient/test/database/auto/GraphDatabaseTest.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreePersistent.java b/core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreePersistent.java index 8e9f9d2b5ef..66677f367ae 100644 --- a/core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreePersistent.java +++ b/core/src/main/java/com/orientechnologies/orient/core/type/tree/OMVRBTreePersistent.java @@ -256,9 +256,14 @@ public void unload() { root = null; final ODatabaseRecord db = ODatabaseRecordThreadLocal.INSTANCE.getIfDefined(); - if (db != null && !db.isClosed()) + if (db != null && !db.isClosed()) { // RELOAD IT - load(); + try { + load(); + } catch (Exception e) { + // IGNORE IT + } + } } catch (Exception e) { OLogManager.instance().error(this, "Error on unload the tree: " + dataProvider, e, OStorageException.class); diff --git a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/GraphDatabaseTest.java b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/GraphDatabaseTest.java index 06a7629920e..d26048cad6d 100755 --- a/tests/src/test/java/com/orientechnologies/orient/test/database/auto/GraphDatabaseTest.java +++ b/tests/src/test/java/com/orientechnologies/orient/test/database/auto/GraphDatabaseTest.java @@ -535,8 +535,8 @@ public void testexpandBlankDatabase() throws IOException { database.removeVertex(playerDoc); database.removeVertex(teamDoc); - ODatabaseHelper.deleteDatabase(database); database.close(); + ODatabaseHelper.deleteDatabase(database); } //