Commit 769087f9 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1561-export-to-model-issue' into 'devel_16.0.x'

detach from db when fetching model

See merge request !1356
parents 599aa3b0 52141e49
Pipeline #47681 passed with stage
in 20 minutes and 52 seconds
......@@ -3,6 +3,8 @@ 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, #1560,
#1559)
-- 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