Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-2759

Static code analysis: potential lock collisions BaseTransactionManagerDelegate#findLock - interned string used as a lock

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 5.3.4.Final
    • Fix Version/s: 5.3.5.Final
    • Component/s: JTS
    • Labels:
      None

      Description

      CID-17577: Bad choice of lock object - Potential lock collisions

      at class BaseTransactionManagerDelegate[9] at method findLock.

      string_literal: The string literal "__LOCKS_MAP" is an interned string.
        interned_string_lock: Locking on an interned string can cause unexpected locking collisions with third party code.
        Instead of using "__LOCKS_MAP" as a lock, create a final field of type Object which is only used as a lock.

      Explanation at description of JBTM-2758

      [9] https://github.com/jbosstm/narayana/blob/master/ArjunaJTS/integration/src/main/java/com/arjuna/ats/jbossatx/BaseTransactionManagerDelegate.java#L350

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ochaloup Ondrej Chaloupka
                  Reporter:
                  ochaloup Ondrej Chaloupka
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: