diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java index 5578eb0ab..79a119773 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/ExamDAO.java @@ -79,7 +79,7 @@ public interface ExamDAO extends ActivatableEntityDAO, BulkActionSup @CacheEvict( cacheNames = ExamSessionCacheService.CACHE_NAME_RUNNING_EXAM, key = "#examId") - String getAppSigantureKeySalt(Long examId); + String getAppSignatureKeySalt(Long examId); /** Saves the Exam and updates the running exam cache. */ @Override @@ -171,7 +171,6 @@ default Result releaseLock(final Exam exam, final String updateId) { /** Use this to check if the exam is up to date * - * @param examId the exam identifier * @param exam the exam to check if it is in sync with the persistent or if there is a newer version * @return Result refer to the up-to-date result or to an error if happened */ Result upToDate(Exam exam); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/AdditionalAttributesDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/AdditionalAttributesDAOImpl.java index 4fbdbc657..5004c810c 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/AdditionalAttributesDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/AdditionalAttributesDAOImpl.java @@ -154,6 +154,7 @@ public Result saveAdditionalAttribute( return this.additionalAttributeRecordMapper .selectByPrimaryKey(rec.getId()); } else { + final AdditionalAttributeRecord rec = new AdditionalAttributeRecord( null, type.name(), @@ -170,6 +171,7 @@ public Result saveAdditionalAttribute( } @Override + @Transactional public boolean initAdditionalAttribute( final EntityType type, final Long entityId, diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java index cf4148cd3..b0e6807a4 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java @@ -497,7 +497,7 @@ public void setModified(final Long examId) { } @Override - public String getAppSigantureKeySalt(final Long examId) { + public synchronized String getAppSignatureKeySalt(final Long examId) { final CharSequence salt = KeyGenerators.string().generateKey(); this.additionalAttributesDAO.initAdditionalAttribute( EntityType.EXAM, diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java index 0a2574297..591622e85 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java @@ -143,7 +143,7 @@ public Result getAppSignatureKeySalt(final Long examId) { return salt; } - return this.examDAO.getAppSigantureKeySalt(examId); + return this.examDAO.getAppSignatureKeySalt(examId); }); } diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientPingBlockingService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientPingBlockingService.java index 471f89282..500452215 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientPingBlockingService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientPingBlockingService.java @@ -59,7 +59,7 @@ public String notifyPing(final String connectionToken, final String instructionC log.error("Failed to get ClientConnectionDataInternal for: {}", connectionToken); } - if (instructionConfirm != StringUtils.EMPTY) { + if (StringUtils.isNotBlank(instructionConfirm)) { this.sebClientInstructionService.confirmInstructionDone(connectionToken, instructionConfirm); }