Compare commits

..

4 Commits

Author SHA1 Message Date
Peter Hormanns
221aea2520 release 4.0.16 2023-09-05 12:17:38 +02:00
Peter Hormanns
4791781eeb null handling 2023-09-05 12:14:22 +02:00
Peter Hormanns
0b3385a3e0 null handling 2023-09-05 12:12:57 +02:00
Peter Hormanns
35862c1c06 null handling 2023-09-05 12:12:13 +02:00
4 changed files with 15 additions and 4 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/qserv-test/

View File

@ -112,6 +112,7 @@ public class QueueStatusReceiverServlet extends HttpServlet
@Override
public void onMessage(Message jmsMessage) {
assert jmsMessage != null;
Transaction transaction = null;
messageCount++;
try {
@ -123,7 +124,13 @@ public class QueueStatusReceiverServlet extends HttpServlet
transaction.beginTransaction();
EntityManager em = transaction.getEntityManager();
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);
Processor processor = persistentQT.getProcessor();
if (processor != null) {
@ -133,6 +140,7 @@ public class QueueStatusReceiverServlet extends HttpServlet
em.flush();
transaction.commitTransaction();
} else {
errorCount++;
final String err = "Deserialization failed " + new Date();
System.out.println(err);
throw new TechnicalException(err);

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.hsadmin</groupId>
<artifactId>hsadmin-qserv</artifactId>
<version>4.0.15</version>
<version>4.0.16</version>
<packaging>jar</packaging>
<name>HSAdmin-QServ</name>
@ -20,7 +20,7 @@
<dependency>
<groupId>de.hsadmin.core</groupId>
<artifactId>hsadmin-qserv</artifactId>
<version>4.0.15</version>
<version>4.0.16</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>

View File

@ -145,8 +145,10 @@ public class Transaction {
if (transactionActive) {
rollbackTransaction();
}
if (entityManager != null) {
entityManager.close();
}
}
/**
* Detach entities from JPA session.