Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-5948

UserTransactionSessionImpl is not thread safe

XMLWordPrintable

    • Medium

      First of all, static TransactionManager check and assignment is not synchronised.

      Secondly, WeakValueHashMap activeTx underneath is a HashMap and hence not thread safe.
      During load testing, seems like transactions were disappearing from activeTx for the same
      reason that transactions were dissapearing from txFailoverAuthorization map which is due to
      lack of synchronisation. This map will now become a Collections.synchronizedMap(new WeakValueHashMap());

      Finally, in spite of making activeTx map a synchronised map, we still need to synchronise on
      activeTx in unreferenced() method as a putIfAbsent type of operation if executed.

              rh-ee-galder Galder ZamarreƱo
              rh-ee-galder Galder ZamarreƱo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: