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

QTI 2.1: red screen possible if a coach reset a running test

    XMLWordPrintable

    Details

      Description

      The red screen has several stack traces but the cause is always the same. A coach or course owner resets the test session of a user which is currently doing the test.

      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
       at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
       at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181)
       at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:188)
       at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:716)
       at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:696)
       at org.olat.ims.qti21.manager.AssessmentItemSessionDAO.createAndPersistAssessmentItemSession(AssessmentItemSessionDAO.java:61)
       at org.olat.ims.qti21.manager.QTI21ServiceImpl.getOrCreateAssessmentItemSession(QTI21ServiceImpl.java:712)
       at org.olat.ims.qti21.ui.AssessmentTestDisplayController.handleTemporaryResponse(AssessmentTestDisplayController.java:1061)
       at org.olat.ims.qti21.ui.AssessmentTestDisplayController.processQTIEvent(AssessmentTestDisplayController.java:744)
       at org.olat.ims.qti21.ui.AssessmentTestDisplayController.event(AssessmentTestDisplayController.java:504)
       at org.olat.core.gui.control.DefaultController$1.run(DefaultController.java:250)
       at org.olat.core.logging.activity.ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(ThreadLocalUserActivityLoggerInstaller.java:108)
       at org.olat.core.gui.control.DefaultController.dispatchEvent(DefaultController.java:247)
       at org.olat.core.gui.control.DefaultController.fireEvent(DefaultController.java:194)
       at org.olat.ims.qti21.ui.AssessmentTestDisplayController$QtiWorksController.fireTemporaryResponse(AssessmentTestDisplayController.java:2126)
       at org.olat.ims.qti21.ui.AbstractQtiWorksController.processTemporaryResponse(AbstractQtiWorksController.java:135)
       at org.olat.ims.qti21.ui.AssessmentTestDisplayController$QtiWorksController.formInnerEvent(AssessmentTestDisplayController.java:2088)
       at org.olat.core.gui.components.form.flexible.impl.FormBasicController.event(FormBasicController.java:430)
       at org.olat.ims.qti21.ui.AssessmentTestDisplayController$QtiWorksController.event(AssessmentTestDisplayController.java:2057)
       at org.olat.core.gui.control.DefaultController.dispatchEvent(DefaultController.java:206)
       at org.olat.core.gui.components.AbstractComponent$1.run(AbstractComponent.java:240)
       at org.olat.core.logging.activity.ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(ThreadLocalUserActivityLoggerInstaller.java:108)
       at org.olat.core.gui.components.AbstractComponent.fireEvent(AbstractComponent.java:238)
       at org.olat.core.gui.components.form.flexible.impl.FormWrapperContainer.fireFormEvent(FormWrapperContainer.java:136)
       at org.olat.core.gui.components.form.flexible.impl.Form.fireFormEvent(Form.java:737)
       at org.olat.ims.qti21.ui.components.AssessmentTestFormItem.evalFormRequest(AssessmentTestFormItem.java:244)
       at org.olat.core.gui.components.form.flexible.impl.Form$EvaluatingFormComponentVisitor.visit(Form.java:646)
       at org.olat.core.util.component.FormComponentTraverser.doVisit(FormComponentTraverser.java:65)
       at org.olat.core.util.component.FormComponentTraverser.doVisit(FormComponentTraverser.java:70)
       at org.olat.core.util.component.FormComponentTraverser.visitAll(FormComponentTraverser.java:60)
       at org.olat.core.gui.components.form.flexible.impl.Form.evalFormRequest(Form.java:285)
       at org.olat.core.gui.components.form.flexible.impl.FormWrapperContainer.doDispatchRequest(FormWrapperContainer.java:105)
       at org.olat.core.gui.components.AbstractComponent.dispatchRequest(AbstractComponent.java:193)
       at org.olat.core.gui.components.Window.doDispatchToComponent(Window.java:1248)
       at org.olat.core.gui.components.Window.dispatchRequest(Window.java:428) ... 39 more Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
       at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:109)
       at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
       at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
       at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
       at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:200)
       at org.hibernate.dialect.identity.GetGeneratedKeysDelegate.executeAndExtract(GetGeneratedKeysDelegate.java:57)
       at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:43)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3133)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3737)
       at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:84)
       at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:645)
       at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:282)
       at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:263)
       at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:317)
       at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:330)
       at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:287)
       at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:193)
       at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:123)
       at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:185)
       at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:128)
       at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:55)
       at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:102)
       at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:710)
      ... 70 more Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "o_qti_assessmentitem_session" violates foreign key constraint "qti_itemsess_to_testsess_idx" Detail: Key (fk_assessmenttest_session)=(67433) is not present in table "o_qti_assessmenttest_session".
       at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
       at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
       at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
       at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
       at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
       at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:150)
       at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:127)
       at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:87)
       at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:87)
       at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197) ... 88 more
      

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            srosse Stéphane Rossé
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: