activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spenceee <>
Subject Possible NMS Transaction bug Transaction GUID not Unique
Date Thu, 11 Aug 2011 05:50:57 GMT
G'day, first time poster, apologies if I'm in the wrong forum.

I think I have found a defect in the NMS 1.5.0 API regarding the allocation
of a Resource Manager GUID in the NetTxConnection class.  This is sent to
the MS DTC as a unique identifier for the resource manager.  I've read the
source code for this class and it is derived from the BrokerInfo.BrokerID
from the connection.  According to MSDN the ID needs to be:

A unique identifier for a resource manager, which should persist across
resource manager failure or reboot.

If I understand correctly, each new connection to the broker will get a new
value for BrokerID.  Therefore I can see little value in deriving the GUID
from the broker info.  I think it would make more sense for
NetTxConnection.ResourceManagerGUID to set the value internally to
Guid.NewGuid(); and then return this value.

        internal resourceManagerGuid = Guid.NewGuid; //Guaranteed* unique
and threadsafe.
        internal Guid ResourceManagerGuid
                 return resourceManagerGuid;

The only reason I can see for receiving this error is if somehow the same
brokerID is returned.  I am using 4 threads to make connections with to the
broker concurrently on 4 separate Active MQ connection objects.

I've santised the error I've received if it's helpful.

Error : 2011/19/12 04:19:44 xxx: Source: System.Transactions
Message: A resource manager with the same identifier is already registered
with the specified transaction coordinator. (Exception from HRESULT:
0x8004D102)Stack:    at
resourceManagerIdentifier, IntPtr managedIdentifier, IResourceManagerShim&
   at System.Transactions.Oletx.OletxResourceManager.Reenlist(Int32
prepareInfoLength, Byte[] prepareInfo, IEnlistmentNotificationInternal
resourceManagerIdentifier, Byte[] recoveryInformation,
IEnlistmentNotificationInternal enlistmentNotification)
   at System.Transactions.TransactionManager.Reenlist(Guid
resourceManagerIdentifier, Byte[] recoveryInformation,
IEnlistmentNotification enlistmentNotification)
   at Apache.NMS.ActiveMQ.TransactionContext.InitializeDtcTxContext()
   at Apache.NMS.ActiveMQ.Connection.CreateSession(AcknowledgementMode
   at xxx.TimeoutRead(Int32 timeOut, Boolean commit) 

View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message