synchronized running exam cache load to prevent multiple long running

transactions while loading an Exam
This commit is contained in:
anhefti 2021-11-11 16:01:35 +01:00
parent b4cf27de63
commit 7de512d7fe
7 changed files with 7 additions and 9 deletions

View file

@ -69,7 +69,7 @@ public class ExamSessionCacheService {
cacheNames = CACHE_NAME_RUNNING_EXAM, cacheNames = CACHE_NAME_RUNNING_EXAM,
key = "#examId", key = "#examId",
unless = "#result == null") unless = "#result == null")
public Exam getRunningExam(final Long examId) { public synchronized Exam getRunningExam(final Long examId) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Verify running exam for id: {}", examId); log.debug("Verify running exam for id: {}", examId);

View file

@ -193,7 +193,7 @@ public class ExamSessionServiceImpl implements ExamSessionService {
} }
@Override @Override
public Result<Exam> getRunningExam(final Long examId) { public synchronized Result<Exam> getRunningExam(final Long examId) {
if (log.isTraceEnabled()) { if (log.isTraceEnabled()) {
log.trace("Running exam request for exam {}", examId); log.trace("Running exam request for exam {}", examId);
} }

View file

@ -39,7 +39,6 @@ public class CachableJdbcTokenStore implements TokenStore {
} }
@Override @Override
@Transactional
public OAuth2AccessToken getAccessToken(final OAuth2Authentication authentication) { public OAuth2AccessToken getAccessToken(final OAuth2Authentication authentication) {
return this.jdbcTokenStore.getAccessToken(authentication); return this.jdbcTokenStore.getAccessToken(authentication);
} }

View file

@ -8,7 +8,7 @@ sebserver.gui.webservice.address=localhost
sebserver.gui.webservice.port=8080 sebserver.gui.webservice.port=8080
sebserver.gui.webservice.apipath=/admin-api/v1 sebserver.gui.webservice.apipath=/admin-api/v1
# defines the polling interval that is used to poll the webservice for client connection data on a monitored exam page # defines the polling interval that is used to poll the webservice for client connection data on a monitored exam page
sebserver.gui.webservice.poll-interval=1000 #sebserver.gui.webservice.poll-interval=1000
sebserver.gui.theme=css/sebserver.css sebserver.gui.theme=css/sebserver.css
sebserver.gui.list.page.size=15 sebserver.gui.list.page.size=15

View file

@ -13,7 +13,7 @@ spring.datasource.hikari.initializationFailTimeout=30000
spring.datasource.hikari.connectionTimeout=30000 spring.datasource.hikari.connectionTimeout=30000
spring.datasource.hikari.idleTimeout=600000 spring.datasource.hikari.idleTimeout=600000
spring.datasource.hikari.maxLifetime=1800000 spring.datasource.hikari.maxLifetime=1800000
spring.datasource.hikari.maximumPoolSize=500 spring.datasource.hikari.maximumPoolSize=5
sebserver.http.client.connect-timeout=15000 sebserver.http.client.connect-timeout=15000
sebserver.http.client.connection-request-timeout=10000 sebserver.http.client.connection-request-timeout=10000
@ -23,7 +23,7 @@ sebserver.webservice.clean-db-on-startup=false
# webservice configuration # webservice configuration
sebserver.init.adminaccount.gen-on-init=false sebserver.init.adminaccount.gen-on-init=false
sebserver.webservice.distributed=false sebserver.webservice.distributed=true
sebserver.webservice.master.delay.threshold=10000 sebserver.webservice.master.delay.threshold=10000
sebserver.webservice.http.external.scheme=http sebserver.webservice.http.external.scheme=http
sebserver.webservice.http.external.servername=localhost sebserver.webservice.http.external.servername=localhost

View file

@ -25,14 +25,13 @@ sebserver.gui.entrypoint=/gui
sebserver.gui.webservice.apipath=${sebserver.webservice.api.admin.endpoint} sebserver.gui.webservice.apipath=${sebserver.webservice.api.admin.endpoint}
# defines the polling interval that is used to poll the webservice for client connection data on a monitored exam page # defines the polling interval that is used to poll the webservice for client connection data on a monitored exam page
sebserver.gui.webservice.poll-interval=3000 sebserver.gui.webservice.poll-interval=2000
sebserver.gui.webservice.mock-lms-enabled=true sebserver.gui.webservice.mock-lms-enabled=true
sebserver.gui.webservice.edx-lms-enabled=true sebserver.gui.webservice.edx-lms-enabled=true
sebserver.gui.webservice.moodle-lms-enabled=true sebserver.gui.webservice.moodle-lms-enabled=true
sebserver.gui.seb.client.config.download.filename=SEBServerSettings.seb sebserver.gui.seb.client.config.download.filename=SEBServerSettings.seb
sebserver.gui.seb.exam.config.download.filename=SEBExamSettings.seb sebserver.gui.seb.exam.config.download.filename=SEBExamSettings.seb
sebserver.gui.proctoring.zoom.websdk.version=1.9.8 sebserver.gui.proctoring.zoom.websdk.version=1.9.8
sebserver.gui.filter.date.from.years=2 sebserver.gui.filter.date.from.years=2
# remote proctoring # remote proctoring

View file

@ -31,7 +31,7 @@ spring.datasource.hikari.initializationFailTimeout=3000
spring.datasource.hikari.connectionTimeout=30000 spring.datasource.hikari.connectionTimeout=30000
spring.datasource.hikari.idleTimeout=600000 spring.datasource.hikari.idleTimeout=600000
spring.datasource.hikari.maxLifetime=1800000 spring.datasource.hikari.maxLifetime=1800000
spring.datasource.hikari.maximumPoolSize=500 spring.datasource.hikari.maximumPoolSize=100
### webservice security ### webservice security
spring.datasource.password=${sebserver.mariadb.password} spring.datasource.password=${sebserver.mariadb.password}