]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/migration/MigrationStateImpl.java
Finalizing improve startup time for fresh or rollback'd session
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / migration / MigrationStateImpl.java
index d7f6b4e95497fe0a1ac0991cf27c38720f316681..f50bae78aa2e8c8ebf702efd86c472c436ce2bea 100644 (file)
@@ -106,12 +106,10 @@ public class MigrationStateImpl implements MigrationState {
                    return (T)tg;
                }
                
-            TransferableGraphFileReader reader = null;
             try {
                 File modelFile = getProperty(MigrationStateKeys.MODEL_FILE);
-                reader = new TransferableGraphFileReader(modelFile);
                 TimeLogger.log(MigrationStateImpl.class, "reading TG into memory from " + modelFile);
-                TransferableGraph1 tg = reader.readTG();
+                TransferableGraph1 tg = TransferableGraphFileReader.read(modelFile);
                 TimeLogger.log(MigrationStateImpl.class, "read TG into memory from " + modelFile);
                 setProperty(MigrationStateKeys.CURRENT_TG, tg);
                 return (T)tg;
@@ -119,8 +117,6 @@ public class MigrationStateImpl implements MigrationState {
                 throw e;
             } catch (Throwable t) {
                 throw new DatabaseException(t);
-            } finally {
-                uncheckedClose(reader);
             }
                
         } else if (MigrationStateKeys.CURRENT_TGS.equals(key)) {