Skip to content
Snippets Groups Projects
Commit 131aa1e3 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '2069-createproject-should-not-be-transactional' into 'master'

Resolve "CreateProject should not be transactional"

Closes #2069

See merge request !1756
parents 3b755fb8 76fc4c1e
No related branches found
No related tags found
1 merge request!1756Resolve "CreateProject should not be transactional"
Pipeline #94097 failed
Showing
with 106 additions and 104 deletions
minerva (17.1.1) unstable; urgency=medium
* Bug fix: sometimes there was a deadlock when uploading a project due (#2069)
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 29 Aug 2024 13:00:00 +0200
minerva (17.1.0) unstable; urgency=medium
* Improvement: downloadModel API call contains strictCutoff parameter
(default=true) to allow selecting reaction that cross polygon (#1769)
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>CellDesigner-plugin</artifactId>
<!-- dependency from the MapViewer model -->
......@@ -50,19 +50,19 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>commons</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>annotation</artifactId>
<name>Annotation module</name>
......@@ -19,7 +19,7 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- dependency from the MapViewer dao -->
......@@ -27,7 +27,7 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>persist</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- dependency from the MapViewer cell designer parser (we need access
......@@ -35,13 +35,13 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- Log4J2 -->
......
......@@ -50,7 +50,7 @@ public class TairAnnotatorImpl extends ElementAnnotator implements TairAnnotator
private static final Logger logger = LogManager.getLogger();
private static final String URL_SOURCE_DATABASE = "https://www.arabidopsis.org/api/download-files/download?filePath=Proteins%2FId_conversions%2FArchived%2FTAIR2UniprotMapping-Jul2023.txt";
private static final String URL_SOURCE_DATABASE = "https://minerva-dev.lcsb.uni.lu/TAIR2UniprotMapping-Jul2023.txt";
private static final int BUFFER_SIZE = 1024;
......
package lcsb.mapviewer.annotation.services.annotators;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.Collection;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.util.ReflectionTestUtils;
import lcsb.mapviewer.annotation.AnnotationTestFunctions;
import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
import lcsb.mapviewer.annotation.cache.WebPageDownloader;
......@@ -21,6 +9,17 @@ import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.species.GenericProtein;
import lcsb.mapviewer.model.map.species.Species;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.util.ReflectionTestUtils;
import java.util.Collection;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
public class TairAnnotatorTest extends AnnotationTestFunctions {
......@@ -30,7 +29,7 @@ public class TairAnnotatorTest extends AnnotationTestFunctions {
@Autowired
private GeneralCacheInterface cache;
private WebPageDownloader webPageDownloader = new WebPageDownloader();
private final WebPageDownloader webPageDownloader = new WebPageDownloader();
@Before
public void setUp() {
......@@ -88,15 +87,15 @@ public class TairAnnotatorTest extends AnnotationTestFunctions {
tairAnnotator.annotateElement(protein);
int cntUniProts = 0;
int countUniprot = 0;
for (final MiriamData md : protein.getMiriamData()) {
if (md.getDataType().equals(MiriamType.UNIPROT)) {
cntUniProts++;
countUniprot++;
}
}
assertTrue("No UNIPROT annotation extracted from TAIR annotator", cntUniProts > 1);
assertTrue("No UNIPROT annotation extracted from TAIR annotator", countUniprot > 1);
}
@Test
......@@ -140,13 +139,13 @@ public class TairAnnotatorTest extends AnnotationTestFunctions {
@Test
public void testTairToUniprotFromKEGG() throws Exception {
// TAIR Loci comming from annotators should be ignored by TAIR (only TAIR
// TAIR Loci coming from annotators should be ignored by TAIR (only TAIR
// LOCI provided by the human annotator should be considered)
Species protein = new GenericProtein("id");
protein.setName("bla");
protein.addMiriamData(new MiriamData(MiriamType.TAIR_LOCUS, "2200427", KeggAnnotator.class));
tairAnnotator.annotateElement(protein);
assertTrue(protein.getMiriamData().size() == 1);
assertEquals(1, protein.getMiriamData().size());
}
@Test
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>commons</artifactId>
<name>Mapviewer commons</name>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>converter-CellDesigner</artifactId>
<name>CellDesigner converter</name>
......@@ -17,13 +17,13 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- Log4J2 -->
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>converter-SBGNML</artifactId>
......@@ -20,26 +20,26 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>persist</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-graphics</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>converter-graphics</artifactId>
<name>MapViewer graphics converter</name>
......@@ -18,13 +18,13 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model-command</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- Log4J2 -->
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>converter-sbml</artifactId>
<name>converter-sbml</name>
......@@ -40,22 +40,22 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model-command</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- Log4J2 -->
......@@ -167,7 +167,7 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-graphics</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
<scope>test</scope>
</dependency>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>converter</artifactId>
......@@ -15,7 +15,7 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>frontend-js</artifactId>
<name>frontend-js</name>
......
......@@ -3,7 +3,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>model-command</artifactId>
<name>Model commands</name>
......@@ -16,7 +16,7 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
......@@ -24,7 +24,7 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- Log4J2-->
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>model</artifactId>
<name>model MapViewer</name>
......@@ -15,7 +15,7 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>commons</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- Java xml serialization -->
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>pathvisio</artifactId>
<name>Pathvisio plugin</name>
......@@ -77,26 +77,26 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-graphics</artifactId>
<scope>test</scope>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model-command</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- Log4J2 -->
......
......@@ -6,7 +6,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>persist</artifactId>
......@@ -26,7 +26,7 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- Hibernate -->
......
......@@ -6,7 +6,7 @@
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
<packaging>pom</packaging>
<name>parent MapViewer</name>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>rest-api</artifactId>
<name>rest-api</name>
......@@ -19,19 +19,19 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>service</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>pathvisio</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>lcsb.mapviewer</groupId>
<artifactId>parent</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</parent>
<artifactId>service</artifactId>
......@@ -20,7 +20,7 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- dependency from the MapViewer dao -->
......@@ -28,47 +28,47 @@
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>persist</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>model-command</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>annotation</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- dependency from the MapViewer cell designer parser -->
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-CellDesigner</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- dependency from the MapViewer SBGN-ML parser -->
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-SBGNML</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- dependency from the MapViewer graphics converter -->
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-graphics</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- dependency from the SBML parser -->
<dependency>
<groupId>lcsb.mapviewer</groupId>
<artifactId>converter-sbml</artifactId>
<version>17.1.0</version>
<version>17.1.1</version>
</dependency>
<!-- Log4J2 -->
......
package lcsb.mapviewer.services.impl;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import javax.annotation.PostConstruct;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.jdbc.datasource.init.ScriptException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import lcsb.mapviewer.annotation.cache.CacheQueryMinervaJob;
import lcsb.mapviewer.annotation.cache.GeneralCacheInterface;
import lcsb.mapviewer.common.MinervaConfigurationHolder;
......@@ -41,13 +14,38 @@ import lcsb.mapviewer.persist.CustomDatabasePopulator;
import lcsb.mapviewer.persist.dao.MinervaJobDao;
import lcsb.mapviewer.persist.dao.cache.CacheTypeDao;
import lcsb.mapviewer.services.interfaces.IMinervaJobService;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.jdbc.datasource.init.ScriptException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
@Service
public class MinervaJobService implements IMinervaJobService, ApplicationContextAware {
private ApplicationContext context;
private Logger logger = LogManager.getLogger();
private final Logger logger = LogManager.getLogger();
private MinervaJobDao minervaJobDao;
......@@ -72,7 +70,7 @@ public class MinervaJobService implements IMinervaJobService, ApplicationContext
@Autowired
public MinervaJobService(final MinervaJobDao minervaJobDao, final GeneralCacheInterface cache, final CacheTypeDao cacheTypeDao,
final CustomDatabasePopulator flyway, final MinervaConfigurationHolder configurationHolder) {
final CustomDatabasePopulator flyway, final MinervaConfigurationHolder configurationHolder) {
this.minervaJobDao = minervaJobDao;
this.cache = cache;
this.cacheTypeDao = cacheTypeDao;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment