Commit 4b5a0194 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

hibernate exceptions on uploading project weren't caught properly

parent eb818a26
Pipeline #17291 failed with stage
in 16 minutes and 50 seconds
......@@ -3,6 +3,8 @@ minerva (14.0.5) stable; urgency=medium
content dialog could crash upload (#1040)
* Bug fix: some annotators (like Cazy) were crashing on old installations
(#1029)
* Bug fix: uploading a map that breaks postgres constraints hung upload of
the project (#1028)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 02 Dec 2019 16:00:00 +0200
......
......@@ -5,6 +5,7 @@ import java.util.*;
import java.util.concurrent.CountDownLatch;
import javax.mail.MessagingException;
import javax.persistence.PersistenceException;
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
......@@ -394,7 +395,7 @@ public class ProjectService implements IProjectService {
}
logger.info("Project " + project.getProjectId() + " created successfully.");
} catch (HibernateException e) {
} catch (PersistenceException e) {
outOfMemoryBuffer = null;
logger.error("Problem with database", e);
handleHibernateExceptionReporting(params, e);
......@@ -1050,7 +1051,7 @@ public class ProjectService implements IProjectService {
* @param e
* exception that occurred during uploading of the project
*/
private void handleHibernateExceptionReporting(CreateProjectParams params, HibernateException e) {
private void handleHibernateExceptionReporting(CreateProjectParams params, PersistenceException e) {
// we need to open separate thread because current one thrown db exception
// and transaction is corrupted and will be rolledback
Thread reportInSeparateThread = new Thread(new Runnable() {
......
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