Compare commits
4 Commits
6e39b2e883
...
221aea2520
Author | SHA1 | Date | |
---|---|---|---|
|
221aea2520 | ||
|
4791781eeb | ||
|
0b3385a3e0 | ||
|
35862c1c06 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/qserv-test/
|
@ -112,6 +112,7 @@ public class QueueStatusReceiverServlet extends HttpServlet
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(Message jmsMessage) {
|
public void onMessage(Message jmsMessage) {
|
||||||
|
assert jmsMessage != null;
|
||||||
Transaction transaction = null;
|
Transaction transaction = null;
|
||||||
messageCount++;
|
messageCount++;
|
||||||
try {
|
try {
|
||||||
@ -123,7 +124,13 @@ public class QueueStatusReceiverServlet extends HttpServlet
|
|||||||
transaction.beginTransaction();
|
transaction.beginTransaction();
|
||||||
EntityManager em = transaction.getEntityManager();
|
EntityManager em = transaction.getEntityManager();
|
||||||
em.clear();
|
em.clear();
|
||||||
QueueTask persistentQT = em.find(QueueTask.class, detachedQT.getId());
|
final long queueTaskId = detachedQT.getId();
|
||||||
|
QueueTask persistentQT = em.find(QueueTask.class, queueTaskId);
|
||||||
|
if (persistentQT == null) {
|
||||||
|
jmsMessage.acknowledge();
|
||||||
|
errorCount++;
|
||||||
|
throw new TechnicalException("QueueTask not found, id: " + queueTaskId);
|
||||||
|
}
|
||||||
persistentQT.assign(detachedQT);
|
persistentQT.assign(detachedQT);
|
||||||
Processor processor = persistentQT.getProcessor();
|
Processor processor = persistentQT.getProcessor();
|
||||||
if (processor != null) {
|
if (processor != null) {
|
||||||
@ -133,6 +140,7 @@ public class QueueStatusReceiverServlet extends HttpServlet
|
|||||||
em.flush();
|
em.flush();
|
||||||
transaction.commitTransaction();
|
transaction.commitTransaction();
|
||||||
} else {
|
} else {
|
||||||
|
errorCount++;
|
||||||
final String err = "Deserialization failed " + new Date();
|
final String err = "Deserialization failed " + new Date();
|
||||||
System.out.println(err);
|
System.out.println(err);
|
||||||
throw new TechnicalException(err);
|
throw new TechnicalException(err);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>de.hsadmin</groupId>
|
<groupId>de.hsadmin</groupId>
|
||||||
<artifactId>hsadmin-qserv</artifactId>
|
<artifactId>hsadmin-qserv</artifactId>
|
||||||
<version>4.0.15</version>
|
<version>4.0.16</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>HSAdmin-QServ</name>
|
<name>HSAdmin-QServ</name>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.hsadmin.core</groupId>
|
<groupId>de.hsadmin.core</groupId>
|
||||||
<artifactId>hsadmin-qserv</artifactId>
|
<artifactId>hsadmin-qserv</artifactId>
|
||||||
<version>4.0.15</version>
|
<version>4.0.16</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.activemq</groupId>
|
<groupId>org.apache.activemq</groupId>
|
||||||
|
@ -145,8 +145,10 @@ public class Transaction {
|
|||||||
if (transactionActive) {
|
if (transactionActive) {
|
||||||
rollbackTransaction();
|
rollbackTransaction();
|
||||||
}
|
}
|
||||||
|
if (entityManager != null) {
|
||||||
entityManager.close();
|
entityManager.close();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detach entities from JPA session.
|
* Detach entities from JPA session.
|
||||||
|
Loading…
Reference in New Issue
Block a user