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

Cannot delete a lecture block linked to an assessment

    XMLWordPrintable

    Details

      Description

      https://testing.frentix.com/test5/auth/RepositoryEntry/113541120/LecturesAdmin/0/LectureBlocks/0
      Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.2 Safari/605.1.15 ^%^ SQL Error: 1451, SQLState: 23000
      Cannot delete or update a parent row: a foreign key constraint fails (`test5`.`o_as_mode_course`, CONSTRAINT `as_mode_to_lblock_idx` FOREIGN KEY (`fk_lecture_block`) REFERENCES `o_lecture_block` (`id`))
      
      <dispatchinfo> 
      	<componentinfo>
      		<compname>link_0</compname>
      		<compclass>org.olat.core.gui.components.link.Link</compclass>
      		<extendedinfo>n/a</extendedinfo>
      		<event>
      			<class&gt;org.olat.core.gui.control.Event</class&gt;
      			<command>link_0</command>
      			<tostring>com:link_0,org.olat.core.gui.control.Event@be46a54a</tostring>
      		</event>
      	</componentinfo>
      	<controllerinfo>
      		<controllername>org.olat.core.gui.control.generic.modal.DialogBoxController</controllername>
      		<controllername>org.olat.modules.lecture.ui.LectureListRepositoryController</controllername>
      		<controllername>org.olat.modules.lecture.ui.LectureRepositoryAdminController</controllername>
      		<controllername>org.olat.course.run.CourseRuntimeController</controllername>
      		<controllername>org.olat.core.commons.fullWebApp.BaseFullWebappController</controllername>
      	</controllerinfo>
      </dispatchinfo>
      
      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.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1534)
       at org.hibernate.query.Query.getResultList(Query.java:165)
       at org.olat.modules.lecture.manager.LectureBlockDAO.getLectureBlocks(LectureBlockDAO.java:177)
       at org.olat.modules.lecture.manager.LectureBlockDAO.getLecturesBlockWithTeachers(LectureBlockDAO.java:464)
       at org.olat.modules.lecture.manager.LectureServiceImpl.getLectureBlocksWithTeachers(LectureServiceImpl.java:1394)
       at org.olat.modules.lecture.ui.LectureListRepositoryController.loadModel(LectureListRepositoryController.java:184)
       at org.olat.modules.lecture.ui.LectureListRepositoryController.event(LectureListRepositoryController.java:276)
       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.core.gui.control.generic.modal.DialogBoxController.event(DialogBoxController.java:221)
       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.link.Link.dispatch(Link.java:205)
       at org.olat.core.gui.components.link.Link.doDispatchRequest(Link.java:192)
       at org.olat.core.gui.components.AbstractComponent.dispatchRequest(AbstractComponent.java:193)
       at org.olat.core.gui.components.Window.doDispatchToComponent(Window.java:1201)
       at org.olat.core.gui.components.Window.dispatchRequest(Window.java:398) 	
      ... 33 more Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
       at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:59)
       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:178)
       at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)
       at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3519)
       at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:3778)
       at org.hibernate.action.internal.EntityDeleteAction.execute(EntityDeleteAction.java:100)
       at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:604)
       at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:478)
       at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:361)
       at org.hibernate.event.internal.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:56)
       at org.hibernate.internal.SessionImpl.autoFlushIfRequired(SessionImpl.java:1454)
       at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1540)
       at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1557)
       at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1525)
      ... 53 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`test5`.`o_as_mode_course`, CONSTRAINT `as_mode_to_lblock_idx` FOREIGN KEY (`fk_lecture_block`) REFERENCES `o_lecture_block` (`id`))
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
       at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
       at com.mysql.jdbc.Util.getInstance(Util.java:408)
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)
       at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
       at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
       at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486)
       at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
       at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
       at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
       at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
       at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
       at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:121)
       at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:121)
       at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:175)
      ... 65 more
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: