Fixed btree file enlistment bug.

git-svn-id: https://hyracks.googlecode.com/svn/branches/hyracks_indexes@379 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeOpHelper.java b/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeOpHelper.java
index 8009a407..eeea95f 100644
--- a/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeOpHelper.java
+++ b/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/dataflow/BTreeOpHelper.java
@@ -123,12 +123,12 @@
 					if (mode == BTreeMode.CREATE_BTREE) {
 						ITreeIndexMetaDataFrame metaFrame = new LIFOMetaDataFrame();
 						try {
-							btree.create(btreeFileId, leafFrame, metaFrame);
-							btree.open(btreeFileId);
+							btree.create(btreeFileId, leafFrame, metaFrame);							
 						} catch (Exception e) {
 							throw new HyracksDataException(e);
 						}
 					}
+					btree.open(btreeFileId);
 					btreeRegistry.register(btreeFileId, btree);
 				}
 			} finally {