Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2551

Deletion of topics in monitoring leads to exception throwing

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.4
    • Fix Version/s: 2.4, 2.3.5
    • Component/s: Tool Forum
    • Labels:
      None

      Description

      Create a forum tool with several topics
      create a lesson

      try to edit from monitoring.
      delete the topic "topic heading"
      save
      it will get saved
      but it will also throw an exception

      org.springframework.dao.DataIntegrityViolationException: Hibernate transaction synchronization: Could not execute JDBC batch update; SQL [delete from tl_lafrum11_message where uid=?]; Cannot delete or update a parent row: a foreign key constraint fails (`lams/tl_lafrum11_message_seq`, CONSTRAINT `FKD2C71F8845213B4D` FOREIGN KEY (`root_message_uid`) REFERENCES `tl_lafrum11_message` (`uid`)); nested exception is java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`lams/tl_lafrum11_message_seq`, CONSTRAINT `FKD2C71F8845213B4D` FOREIGN KEY (`root_message_uid`) REFERENCES `tl_lafrum11_message` (`uid`))
      java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`lams/tl_lafrum11_message_seq`, CONSTRAINT `FKD2C71F8845213B4D` FOREIGN KEY (`root_message_uid`) REFERENCES `tl_lafrum11_message` (`uid`))
      at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1269)

        Activity

        Hide
        dronych Andrey Balan added a comment -
        fixed 2 problems:
        - when lesson gets created not all MessageSeq objects were stored in DB
        - Message's cascade="all-delete-orphan" Hibernate setting which prevented deletion of topics
        Show
        dronych Andrey Balan added a comment - fixed 2 problems: - when lesson gets created not all MessageSeq objects were stored in DB - Message's cascade="all-delete-orphan" Hibernate setting which prevented deletion of topics
        Hide
        ernieg Ernie Ghiglione added a comment -
        This works great for LAMS 2.3.5... however, I did get an error for 2.4:

        org.springframework.dao.TransientDataAccessResourceException: Hibernate flushing: Could not execute JDBC batch update; SQL [update tl_lafrum11_timestamp set timestamp_date=?, forum_user_uid=?, message_uid=? where uid=?]; Connection is read-only. Queries leading to data modification are not allowed; nested exception is java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

        One of the things that I noticed was that one file wasn't merged into HEAD. Could that be the cause?

        Show
        ernieg Ernie Ghiglione added a comment - This works great for LAMS 2.3.5... however, I did get an error for 2.4: org.springframework.dao.TransientDataAccessResourceException: Hibernate flushing: Could not execute JDBC batch update; SQL [update tl_lafrum11_timestamp set timestamp_date=?, forum_user_uid=?, message_uid=? where uid=?]; Connection is read-only. Queries leading to data modification are not allowed; nested exception is java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed One of the things that I noticed was that one file wasn't merged into HEAD. Could that be the cause?
        Hide
        dronych Andrey Balan added a comment -
        Hi Ernie,

        can you please check this one more time. as it works ok for me.

        however I found another problem with forum tool LDEV-2608
        Show
        dronych Andrey Balan added a comment - Hi Ernie, can you please check this one more time. as it works ok for me. however I found another problem with forum tool LDEV-2608
        Hide
        ernieg Ernie Ghiglione added a comment -
        Yes, you are right... the issue I raise is a separate issue.

        Thanks.

        Closed and tested in both 2.3.5 and 2.4.
        Show
        ernieg Ernie Ghiglione added a comment - Yes, you are right... the issue I raise is a separate issue. Thanks. Closed and tested in both 2.3.5 and 2.4.

          People

          • Assignee:
            ernieg Ernie Ghiglione
            Reporter:
            dronych Andrey Balan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development