Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-1880

Topic assignment: RS when accepting a candidate

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.4.5
    • Fix Version/s: 10.4.6
    • Component/s: None
    • Labels:
      None

      Description

      In topic assignment, when accepting a candidate for the topic, a RS occurs. The stack trace is:

      message:could not initialize proxy - no Session,org.hibernate.LazyInitializationException
      
      at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:165)
      at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:286)
      at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:185)
      at org.olat.group.BusinessGroupImpl_$$_jvst5e7_17.getKey(BusinessGroupImpl_$$_jvst5e7_17.java)
      at org.olat.group.manager.BusinessGroupDAO.loadForUpdate(BusinessGroupDAO.java:237)
      

      My suggestion is, to store the group key in a variable before detaching the group from the CurrentEntityManager and using the variable later:

      diff --git a/src/main/java/org/olat/group/manager/BusinessGroupDAO.java b/src/main/java/org/olat/group/manager/BusinessGroupDAO.java
      --- a/src/main/java/org/olat/group/manager/BusinessGroupDAO.java
      +++ b/src/main/java/org/olat/group/manager/BusinessGroupDAO.java
      @@ -225,6 +225,7 @@
       	}
       	
       	public BusinessGroup loadForUpdate(BusinessGroup group) {
      +		long groupKey = group.getKey();
       		StringBuilder sb = new StringBuilder();
       		sb.append("select bgi from businessgroup bgi ")
       			.append(" inner join fetch bgi.resource resource")
      @@ -234,7 +235,7 @@
       		}
       		List<BusinessGroup> groups = dbInstance.getCurrentEntityManager()
       				.createQuery(sb.toString(), BusinessGroup.class)
      -				.setParameter("key", group.getKey())
      +				.setParameter("key", groupKey)
       				.setLockMode(LockModeType.PESSIMISTIC_WRITE)
       				.getResultList();
       		if(groups.isEmpty()) return null;
      

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            stephan Stephan Clemenz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m