I have an application where Worflows are instantiated from messages from MSMQ. When reading a message from MSMQ, it automatically creates a transaction, probably using TransactionScope.
Within this transaction, we have some custom code that writes to the database. However, we receive the following exception:
Code: Select all
Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
StackTrace: at Devart.Common.r.d()
at Devart.Common.r.a(Enlistment A_0)
at System.Transactions.Oletx.OletxVolatileEnlistment.Rollback()
at System.Transactions.Oletx.OletxPhase1VolatileEnlistmentContainer.Aborted()
at System.Transactions.Oletx.OletxTransactionManager.ShimNotificationCallback(Object state, Boolean timeout)
at System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(Object state, Boolean timedOut)
A quick look through Reflector reveals the code below. My feeling is that the Transaction is null, causing the exception.
Code: Select all
public void d()
{
lock (b.SyncRoot)
{
b.Remove(this.c.Transaction.GetHashCode());
}
}