Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-7042

Multiple triggers with rowLocking = false causes deadlock

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 10.8.2.2, 10.8.3.0, 10.9.1.0, 10.10.1.1, 10.10.2.0, 10.11.1.1, 10.12.1.1, 10.13.1.1, 10.14.1.0, 10.14.2.0, 10.15.1.3
    • None
    • Documentation, JDBC
    • Repro attached
    • Performance, Regression

    Description

      Repro for the bug can be found here: https://github.com/mjschuetze102/TriggerRepro

      Includes a detailed README of steps that show effect of bug as well as two versions of the Derby database. 10.8.1.2, the last version where the bug was not present and version 10.14.1.0, for easy access.

      This may just be an issue of not having enough documentation on database Triggers (see Conclusions Based on Results)

      Summary of Issue

      Having multiple triggers with 'derby.storage.rowLocking', 'false' causes issues with deadlocking

      1. Executing Update trigger causes deadlock when there is an Insert or Delete trigger
      2. Executing Insert trigger causes deadlock when there is a Delete trigger
      3. Executing Delete trigger does not cause deadlock

      'derby.locks.deadlockTimeout' does not seem to work in above case

      1. While executing issue above, none of the triggers were terminated and waitTimeout time was hit

      Conclusions Based on Results

      Having multiple triggers with 'derby.storage.rowLocking', 'false' causes issues with deadlocking

      Triggers seem to get into deadlock scenarios with any trigger defined after itself. If this is the case, it should be documented somewhere that rowLocking needs to be enabled to use the trigger feature if multiple triggers would be used on the same database table.

      'derby.locks.deadlockTimeout' does not seem to work in above case

      Based on documentation, I could not find any concrete evidence of whether this is intended functionality.

      Attachments

        1. Derby7042.java
          8 kB
          Richard N. Hillegas
        2. Derby7042.java
          7 kB
          Richard N. Hillegas

        Activity

          People

            Unassigned Unassigned
            mjschuetze102 Michael Schuetze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: