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

Improve the error raised by too much contention on a sequence/identity.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.8.2.2, 10.9.1.0
    • Fix Version/s: 10.8.2.2, 10.9.1.0
    • Component/s: SQL
    • Labels:
      None
    • Urgency:
      Blocker
    • Issue & fix info:
      Newcomer

      Description

      Currently, when there is too much contention on a sequence/identity, Derby raises an error saying so. There are two properties which the user can adjust in order to reduce the risk of this error:

      derby.locks.waitTimeout
      derby.language.sequence.preallocator

      It would be good to point the user at these knobs. The following change would improve this error reporting:

      1) Raise a lock timeout SQLException

      2) Chain a "too much contention" SQLException (X0Y84) to the lock timeout.

      3) Make the "too much contention" exception suggest that the user adjust the properties mentioned above.

      To make the code easier to understand, the exception raising could replace the loop exit inside the following "if" block in SequenceUpdater.getCurrentValueAndAdvance():

      if (
      (_lockTimeoutInMillis >= 0L) &&
      ( (System.currentTimeMillis() - startTime.longValue()) > _lockTimeoutInMillis )
      )

      { break; }

      This approach was recommended by the discussion on DERBY-5423.

        Attachments

        1. DERBY4437Sequence.java
          2 kB
          Mamta A. Satoor
        2. derby-5426-01-aa-improveError.diff
          4 kB
          Rick Hillegas

          Issue Links

            Activity

              People

              • Assignee:
                rhillegas Rick Hillegas
                Reporter:
                rhillegas Rick Hillegas
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: