X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Futil%2FTGRepresentation.java;h=ed7ae5193837190debb03efdc7c6244a1898d7fc;hp=0f9ffa0a73730314f7ba6d56a655f507d28d9b0c;hb=61033f112b0a2e643bf8530b99bcf90c64464f30;hpb=a82ce25ddc45bcce41927d57f0a05dfe6a3744a6 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/TGRepresentation.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/TGRepresentation.java index 0f9ffa0a7..ed7ae5193 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/TGRepresentation.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/TGRepresentation.java @@ -1,5 +1,6 @@ package org.simantics.db.layer0.util; +import java.io.IOException; import java.util.Arrays; import java.util.Map; @@ -49,9 +50,11 @@ public class TGRepresentation implements Representation { configuration.exclusionFunction = TGRepresentationUtils.computeExclusionFunction(graph, resources, hints); } - ModelTransferableGraphSource source = graph.syncRequest(new ModelTransferableGraphSourceRequest(configuration)); - return TransferableGraphs.create(graph, source); - + try (ModelTransferableGraphSource source = graph.syncRequest(new ModelTransferableGraphSourceRequest(configuration))) { + return TransferableGraphs.create(graph, source); + } catch (IOException e) { + throw new DatabaseException(e); + } } @SuppressWarnings("unchecked")