{"action":"opened","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate/issues/201","repository_url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate","labels_url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate/issues/201/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus.NHibernate/issues/201/events","html_url":"https://github.com/Particular/NServiceBus.NHibernate/issues/201","id":159162495,"number":201,"title":"Using SQL Azure for persistence fails for V6 with NRE","user":{"login":"ramonsmits","id":152998,"avatar_url":"https://avatars.githubusercontent.com/u/152998?v=3","gravatar_id":"","url":"https://api.github.com/users/ramonsmits","html_url":"https://github.com/ramonsmits","followers_url":"https://api.github.com/users/ramonsmits/followers","following_url":"https://api.github.com/users/ramonsmits/following{/other_user}","gists_url":"https://api.github.com/users/ramonsmits/gists{/gist_id}","starred_url":"https://api.github.com/users/ramonsmits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramonsmits/subscriptions","organizations_url":"https://api.github.com/users/ramonsmits/orgs","repos_url":"https://api.github.com/users/ramonsmits/repos","events_url":"https://api.github.com/users/ramonsmits/events{/privacy}","received_events_url":"https://api.github.com/users/ramonsmits/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-08T13:23:47Z","updated_at":"2016-06-08T13:23:47Z","closed_at":null,"body":"\r\nIf using SQL Azure this fails with the following NullReferenceException with NServiceBus V6. Not an issue with V5.\r\n\r\nIt looks like it is related to promoting to a distributed transaction. The transport used is MSMQ and \r\n\r\n\r\n# Exception info\r\n```\r\n2016-06-08 13:13:50.9464|INFO|12|NServiceBus.FirstLevelRetriesBehavior|First Level Retry is going to retry message '58fcada3-b163-4f12-a4ca-a61f00fafc62' because of an exception:\r\nSystem.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.\r\n   at System.Transactions.Transaction.GetPromotedToken()\r\n   --- End of inner exception stack trace ---\r\n   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n   at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)\r\n   at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)\r\n   at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)\r\n   at System.Data.ProviderBase.DbConnectionPool.PrepareConnection(DbConnection owningObject, DbConnectionInternal obj, Transaction transaction)\r\n   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)\r\n   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)\r\n   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)\r\n   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)\r\n   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)\r\n   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)\r\n   at System.Data.SqlClient.SqlConnection.Open()\r\n   at NHibernate.Connection.DriverConnectionProvider.GetConnection()\r\n   at NServiceBus.Persistence.NHibernate.NHibernateSynchronizedStorageAdapter.TryAdapt(TransportTransaction transportTransaction, ContextBag context)\r\n   at NServiceBus.LoadHandlersConnector.<AdaptOrOpenNewSynchronizedStorageSession>d__2.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Pipeline\\Incoming\\LoadHandlersConnector.cs:line 56\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.LoadHandlersConnector.<Invoke>d__1.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Pipeline\\Incoming\\LoadHandlersConnector.cs:line 26\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.InvokeSagaNotFoundBehavior.<Invoke>d__0.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Sagas\\InvokeSagaNotFoundBehavior.cs:line 16\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.MutateIncomingMessageBehavior.<Invoke>d__0.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Pipeline\\MutateInstanceMessage\\MutateIncomingMessageBehavior.cs:line 28\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.DeserializeLogicalMessagesConnector.<Invoke>d__1.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Pipeline\\Incoming\\DeserializeLogicalMessagesConnector.cs:line 30\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.SubscriptionReceiverBehavior.<Invoke>d__1.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Routing\\MessageDrivenSubscriptions\\SubscriptionReceiverBehavior.cs:line 30\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.MutateIncomingTransportMessageBehavior.<Invoke>d__0.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Pipeline\\MutateTransportMessage\\MutateIncomingTransportMessageBehavior.cs:line 27\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.UnitOfWorkBehavior.<Invoke>d__0.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\UnitOfWork\\UnitOfWorkBehavior.cs:line 26\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at NServiceBus.UnitOfWorkBehavior.<Invoke>d__0.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\UnitOfWork\\UnitOfWorkBehavior.cs:line 48\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.ProcessingStatisticsBehavior.<Invoke>d__0.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Performance\\Statistics\\ProcessingStatisticsBehavior.cs:line 25\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.CriticalTimeBehavior.<Invoke>d__1.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Performance\\Statistics\\CriticalTime\\CriticalTimeBehavior.cs:line 16\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.ReceivePerformanceDiagnosticsBehavior.<Invoke>d__2.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Performance\\Statistics\\ReceivePerformanceDiagnosticsBehavior.cs:line 40\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.TransportReceiveToPhysicalMessageProcessingConnector.<Invoke>d__1.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Pipeline\\Incoming\\TransportReceiveToPhysicalMessageProcessingConnector.cs:line 38\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()\r\n   at NServiceBus.Performance.StatisticsBehavior.<Invoke>d__2.MoveNext() in S:\\particular\\EndToEnd\\src\\PerformanceTests\\Common\\Statistics\\StatisticsBehavior.V6.cs:line 29\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at NServiceBus.FirstLevelRetriesBehavior.<Invoke>d__1.MoveNext() in C:\\Build\\src\\NServiceBus.Core\\Recoverability\\FirstLevelRetries\\FirstLevelRetriesBehavior.cs:line 21\r\n```"}}
{"actor":{"display_login":"ramonsmits"}}