Index: lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml
===================================================================
diff -u -r16cd3133dc19ff6616b672670eb509da8eef590e -r733eb2e21e1eb54366032ebb068168f7315c6cf5
--- lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml (.../learningApplicationContext.xml) (revision 16cd3133dc19ff6616b672670eb509da8eef590e)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml (.../learningApplicationContext.xml) (revision 733eb2e21e1eb54366032ebb068168f7315c6cf5)
@@ -55,7 +55,7 @@
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
- PROPAGATION_REQUIRED,+java.lang.Exception
+ PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED,readOnly
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java
===================================================================
diff -u -r8d65c7f51b3ecf744f55283d17bbb10d8c29eb95 -r733eb2e21e1eb54366032ebb068168f7315c6cf5
--- lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java (.../LearnerService.java) (revision 8d65c7f51b3ecf744f55283d17bbb10d8c29eb95)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java (.../LearnerService.java) (revision 733eb2e21e1eb54366032ebb068168f7315c6cf5)
@@ -1042,21 +1042,9 @@
try {
toolSession = lamsCoreToolService.createToolSession(learner, toolActivity, lesson);
} catch (DataIntegrityViolationException e) {
- LearnerService.log.warn("There was an attempt to create two tool sessions with the same name. Retrying...",
- e);
- /*
- * LDEV-1533: Two users tried to create a tool session with the same name. One of them was successful, the
- * other got an error. The second one will now retry. This might create a loop; on the other hand the second
- * attempt should be successful, since either the existing session will be retrieved or a session with a new
- * name will be created.
- *
- * This workaround can not be in LamsCoreToolService (initially it was). If the exception occurs, the
- * transaction is unusable anymore and any further DB actions will throw an error. We need to restart the
- * transaction on the higher level - here.
- *
- * This exception should never occur, as lamsCoreToolService.createToolSession is now synchronized.
- * Nevertheless, it sometimes occurs, so additional security measures stay.
- */
+ LearnerService.log
+ .warn("There was an attempt to create two tool sessions with the same name. Skipping further attempts as the session exists.",
+ e);
}
if (toolSession != null) {
toolActivity.getToolSessions().add(toolSession);
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LoadToolActivityAction.java
===================================================================
diff -u -r3964cdfe296f1449e9b31978efc16e4a38a1c5d6 -r733eb2e21e1eb54366032ebb068168f7315c6cf5
--- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LoadToolActivityAction.java (.../LoadToolActivityAction.java) (revision 3964cdfe296f1449e9b31978efc16e4a38a1c5d6)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LoadToolActivityAction.java (.../LoadToolActivityAction.java) (revision 733eb2e21e1eb54366032ebb068168f7315c6cf5)
@@ -75,14 +75,10 @@
ActivityMapping actionMappings = LearnerServiceProxy.getActivityMapping(this.getServlet().getServletContext());
ICoreLearnerService learnerService = getLearnerService();
- LearnerProgress learnerProgress = LearningWebUtil.getLearnerProgress(request, learnerService);
- Activity activity = LearningWebUtil.getActivityFromRequest(request, learnerService);
- try {
- learnerService.createToolSessionsIfNecessary(activity, learnerProgress);
- } catch (Exception e) {
- log.warn("Got exception while trying to create a tool session, but carrying on.", e);
- }
-
+ LearnerProgress learnerProgress = LearningWebUtil.getLearnerProgress(request,learnerService);
+ Activity activity = LearningWebUtil.getActivityFromRequest(request, learnerService);
+ learnerService.createToolSessionsIfNecessary(activity, learnerProgress);
+
form.setActivityID(activity.getActivityId());
String mappingName = "displayTool";