2015-06-04 27 views
-1

我一直在獲取ResourceManager錯誤。我用下面的代碼:具有相同標識符的資源管理器已註冊到指定的事務協調器

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 
    […] 

有其他人遇到這個問題?

+0

請有人知道這個錯誤。我被這個錯誤困住了。我讀過Udi Dahan的文章http://docs.particular.net/nservicebus/ravendb/resourcemanagerid實現了不斷的resourcemangerid。刪除了所有現有的MSMQ文件夾,也刪除了現有的Ravendb。重新啓動一切仍然是在發送消息時拋出此異常 –

回答

0

這裏是我找到了解決辦法:

我創造了6個端點每個我所用相同的ResourceManagerId端點。一旦我爲每個端點創建了不同的ResourceManagerId(常量guid),這個問題就解決了。

相關問題