Index: lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml,v diff -u -r1.31 -r1.32 --- lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml 12 Dec 2013 11:33:08 -0000 1.31 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/learningApplicationContext.xml 12 Dec 2013 12:15:39 -0000 1.32 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java,v diff -u -r1.108 -r1.109 --- lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java 12 Dec 2013 10:50:15 -0000 1.108 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/service/LearnerService.java 12 Dec 2013 12:15:39 -0000 1.109 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LoadToolActivityAction.java,v diff -u -r1.18 -r1.19 --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LoadToolActivityAction.java 12 Dec 2013 11:41:01 -0000 1.18 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LoadToolActivityAction.java 12 Dec 2013 12:15:39 -0000 1.19 @@ -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";