Now there are only a few places in the code that synchronize explicitly on trans. These are methods doing linear search of the transaction table, primarily during checkpoint and for diagnostics, as well when a global XA transaction is started.
These are the methods doing linear search with explicit synchronization on trans:
In addition you have hasActiveUpdateTransaction() whose comments indicate that synchronization on trans is needed, but it currently only synchronizes on "this". And in sane builds, toString() is called from within the synchronized block in getTransactionInfo() and performs a linear search.
If we change the above mentioned methods so that they use visitors instead of iterating through the transaction table themselves, we will have explicit synchronization on trans in just one method - visitEntries(). Having just a single method to override when adding ConcurrentHashMap sounds attractive, so I will attempt to make such a change.
There are more methods that search the Hashtable linearly, but without synchronization because they are only called during boot/recovery, according to their comments. These methods are:
These methods do not need any changes when switching between Hashtable and ConcurrentHashMap, because they are only used when the engine is running single-threaded, and they do not depend on the synchronization properties of Hashtable.