[infinispan-issues] [JBoss JIRA] (ISPN-1705) DummyXid should use a better implementation for generating branch and transaction identifiers

Manik Surtani (JIRA) jira-events at lists.jboss.org
Wed Jan 11 10:47:22 EST 2012


Manik Surtani created ISPN-1705:
-----------------------------------

             Summary: DummyXid should use a better implementation for generating branch and transaction identifiers
                 Key: ISPN-1705
                 URL: https://issues.jboss.org/browse/ISPN-1705
             Project: Infinispan
          Issue Type: Bug
          Components: Transactions
    Affects Versions: 5.1.0.CR3
            Reporter: Manik Surtani
            Assignee: Mircea Markus
            Priority: Critical
             Fix For: 5.1.0.FINAL


In 5.1.0, the DummyXid was modified to use UUIDs to generate full branch and transaction identifiers.  The most and least significant longs of each UUID was used to populate a part of a 64-byte array (the rest of the array being set to 0).

This poses a number of problems.

1.  Generating 2 UUIDs for each XID is expensive
2.  Most of the 64-byte array is set to 0 and wasted
3.  XID.hashcode() is implemented by performing Arrays.hashcode on each of the (mostly-empty) 64-bit arrays

This makes using the DummyTransactionManager (and consequently, the BatchModeTransactionManager) extremely efficient - if XA compliant.

This JIRA proposes to change this such that:

1.  Each transaction manager creates a single UUID as a transaction manager ID
2.  Each XID created uses an atomic long for transaction and branch ID
3.  Combining most and least significant long of the transaction manager ID with the long counter can provide both transaction and branch identifiers.
4.  Hashcode should be calculated on the above 3 longs ONLY, not the full array, and should be cached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list