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 5578eb0a..79a11977 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 @@ public interface ExamDAO extends ActivatableEntityDAO, BulkActionSup /** 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 4fbdbc65..5004c810 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 class AdditionalAttributesDAOImpl implements AdditionalAttributesDAO { return this.additionalAttributeRecordMapper .selectByPrimaryKey(rec.getId()); } else { + final AdditionalAttributeRecord rec = new AdditionalAttributeRecord( null, type.name(), @@ -170,6 +171,7 @@ public class AdditionalAttributesDAOImpl implements AdditionalAttributesDAO { } @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 cf4148cd..b0e6807a 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 class ExamDAOImpl implements ExamDAO { } @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 0a257429..591622e8 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 class ExamSessionServiceImpl implements ExamSessionService { 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 471f8928..50045221 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 class SEBClientPingBlockingService implements SEBClientPingService { log.error("Failed to get ClientConnectionDataInternal for: {}", connectionToken); } - if (instructionConfirm != StringUtils.EMPTY) { + if (StringUtils.isNotBlank(instructionConfirm)) { this.sebClientInstructionService.confirmInstructionDone(connectionToken, instructionConfirm); }