]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/migration/MigrationUtils.java
Importing TG files creates copies of files without deleting them.
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / migration / MigrationUtils.java
index e1421df90a89054f23d0a4625665f90ccf8be527..7cd73366061033c5374b71a70212065428c6363d 100644 (file)
@@ -358,11 +358,13 @@ public class MigrationUtils {
        
         Collection<Identity> roots = TransferableGraphUtils.getRoots(tg);
         if(roots.size() == 1) {
+               MigrationState state = newState();
             try {
                 TGTransferableGraphSource tgSource = new TGTransferableGraphSource(tg);
                 SharedOntologyImportAdvisor advisor = new SharedOntologyImportAdvisor(published);
 
-                MigrationState state = newState();
+                
+                
                 state.setProperty(MigrationStateKeys.UPDATE_DEPENDENCIES, false);
                 state.setProperty(MigrationStateKeys.CURRENT_TGS, tgSource);
                 state.setProperty(MigrationStateKeys.SESSION, session);
@@ -383,6 +385,7 @@ public class MigrationUtils {
                        } catch (Exception e) {
                            throw new DatabaseException(e);
             } finally {
+               state.dispose();
                 session.getService(XSupport.class).setServiceMode(false, false);
             }