A resource manager with the same identifier is already registered with the specified transaction coordinator

-1

I am consistently getting ResourceManager error. I use below code:

public static IDocumentStore Initialize()
{
    const string id = "2a5434cf-56f6-4b33-9661-5b6cc53bd9a5";
    _instance = new DocumentStore
    {
        Url = "http://localhost:8085",
        DefaultDatabase = "Testing",
        ResourceManagerId = new Guid(id)
    };
    _instance.Initialize();
    return _instance;
}

Here's the call stack:

2015-06-04 15:39:08.366 INFO  NServiceBus.Unicast.Transport.TransportReceiver Failed to process message
System.Runtime.InteropServices.COMException (0x8004D102): A resource manager with the same identifier is already registered with the specified transaction coordinator. (Exception from HRESULT: 0x8004D102)
   at System.Transactions.Oletx.IDtcProxyShimFactory.CreateResourceManager(Guid resourceManagerIdentifier, IntPtr managedIdentifier, IResourceManagerShim& resourceManagerShim)
   at System.Transactions.Oletx.OletxResourceManager.get_ResourceManagerShim()
   at System.Transactions.Oletx.OletxResourceManager.EnlistDurable(OletxTransaction oletxTransaction, Boolean canDoSinglePhase, IEnlistmentNotificationInternal enlistmentNotification, EnlistmentOptions enlistmentOptions)
   at System.Transactions.Oletx.OletxTransaction.EnlistDurable(Guid resourceManagerIdentifier, ISinglePhaseNotificationInternal singlePhaseNotification, Boolean canDoSinglePhase, EnlistmentOptions enlistmentOptions)
   at System.Transactions.TransactionStatePromotedBase.EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
   at System.Transactions.Transaction.EnlistDurable(Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptionsenlistmentOptions)
   at Raven.Client.Document.InMemoryDocumentSessionOperations.TryEnlistInAmbientTransaction() in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Document\InMemoryDocumentSessionOperations.cs:line 1082
   at Raven.Client.Document.InMemoryDocumentSessionOperations.PrepareForSaveChanges() in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Document\InMemoryDocumentSessionOperations.cs:line 931
   at Raven.Client.Document.DocumentSession.SaveChanges() in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Document\DocumentSession.cs:line 707
   at NServiceBus.RavenDB.SessionManagement.OpenSessionBehavior.Invoke(IncomingContext context, Action next) in c:\BuildAgent\work\c4d62ce02b983878\src\NServiceBus.RavenDB\SessionManagement\OpenSessionBehavior.cs:line 22
   […]

Has anyone else come across this issue?

ravendb
nservicebus
asked on Stack Overflow Jun 4, 2015 by Rupesh Kumar Tiwari • edited Nov 13, 2015 by Community

1 Answer

0

Here is the solution I found:

I had created 6 endpoints for each of the endpoint I was using same ResourceManagerId. Once I created different ResourceManagerId (constant guid) for each endpoint this issue got resolved.

answered on Stack Overflow Jun 4, 2015 by Rupesh Kumar Tiwari • edited Jun 8, 2015 by Rupesh Kumar Tiwari

User contributions licensed under CC BY-SA 3.0