Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-5890

Suggestion for Deadlock-Retrying in @Transactional annotation

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.2 RC2
    • Fix Version/s: None
    • Component/s: Transaction
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      If you use locking on databases, you always have to provide for the situation that your transaction rolls backe because of being selected as a deadlock victim.

      The usual behaviour to deal with this situation is to retry some time later (e.g. 1s).

      I think this is something that could be handled by a framework like Spring. If the method that has the transaction facade does not have any side effects (like modifying the input parameters or modifying some entity that is not part of the transaction), a proxy (or perhaps the TransactionInterceptor) could just call the same method again and again - until the transaction succeeds, rolls back because of another reason than deadlock victim, or a configurable timeout elapses.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gertjan_schouten Gert-Jan Schouten
              Last updater:
              Trevor Marshall
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 49 weeks, 2 days ago