Commit bbc8e1a2 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

detach from db when fetching model

parent fedd9d57
Pipeline #47673 canceled with stage
in 2 minutes and 20 seconds
......@@ -3,6 +3,7 @@ minerva (16.0.0~beta.3) stable; urgency=medium
* Bug fix: typo (#1555)
* Bug fix: gene mapping with empty url caused issues when opening info window
(#1557)
* Bug fix: issues with exporting map to file or image fixed (#1561)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 27 Sep 2021 08:00:00 +0200
......
......@@ -232,6 +232,9 @@ public class ModelService implements IModelService {
map.getParentModels().clear();
for (Element element : map.getElements()) {
if (element.getGlyph() != null) {
Hibernate.initialize(element.getGlyph().getFile());
}
if (element instanceof Complex) {
((Complex) element).setElemets(new ArrayList<>());
}
......@@ -246,14 +249,12 @@ public class ModelService implements IModelService {
((Species) element).getComplex().addSpecies((Species) element);
}
}
if (element.getCompartment()!=null) {
if (element.getCompartment() != null) {
element.getCompartment().addElement(element);
}
}
for (Element element : map.getElements()) {
dbUtils.detach(element);
}
dbUtils.detach(map);
dbUtils.getSessionForCurrentThread().clear();
return new ModelFullIndexed(map);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment