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

Unnecessary synchronization in TransactionTable.add()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 10.6.1.0
    • None
    • Store
    • None
    • Performance

    Description

      impl.store.raw.xact.TransactionTable.add() has a synchronized block around the code that adds a transaction to the transaction table. It synchronizes on "this".

      My understanding of the synchronization in the TransactionTable class is that synchronization on "this" is only used to give a consistent view of the set of update transactions. It is typically used to guard state transitions for transactions from read to update, removal of update transactions from the table, and writing the update transactions to the log during checkpointing.

      No transition to/from update happens in this synchronized block (the entry that's added is initialized with the update flag cleared), so I believe that the synchronization could be removed. The code will still be implicitly synchronized on the Hashtable so that it should be safe to access it from multiple threads.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              knutanders Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: