具有相同标识符的资源管理器已经注册到指定的事务协调器 [英] A resource manager with the same identifier is already registered with the specified transaction coordinator

查看:60
本文介绍了具有相同标识符的资源管理器已经注册到指定的事务协调器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直收到 ResourceManager 错误.我使用以下代码:

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;
}

这是调用堆栈:

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?

推荐答案

这是我找到的解决方案:

Here is the solution I found:

我为每个使用相同 ResourceManagerId 的端点创建了 6 个端点.一旦我为每个端点创建了不同的 ResourceManagerId(常量 guid),这个问题就得到了解决.

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.

这篇关于具有相同标识符的资源管理器已经注册到指定的事务协调器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆