B
Bill
I am using the below code to create a transaction but for some reason when
Abort() gets called the ReceiveById() is not rolled back and my message is
removed from the queue and lost. Shouldn't the message stay in the queue if
the Abort is called? Is there something else I may be missing?
MessageQueueTransaction mqt = new MessageQueueTransaction();
try
{
mqt.Begin();
Message msg =
myQueue.ReceiveById(ID,MessageQueueTransactionType.Automatic);
LogMessage logmsg = (LogMessage) msg.Body;
UpdateDatabase(logmsg)
mqt.Commit()
}catch(Exception e)
{
mqt.Abort()
}
The queue is created using this..
MessageQueue.Create(".\\" + QueueName,true);
Any help would be appreciated.
Abort() gets called the ReceiveById() is not rolled back and my message is
removed from the queue and lost. Shouldn't the message stay in the queue if
the Abort is called? Is there something else I may be missing?
MessageQueueTransaction mqt = new MessageQueueTransaction();
try
{
mqt.Begin();
Message msg =
myQueue.ReceiveById(ID,MessageQueueTransactionType.Automatic);
LogMessage logmsg = (LogMessage) msg.Body;
UpdateDatabase(logmsg)
mqt.Commit()
}catch(Exception e)
{
mqt.Abort()
}
The queue is created using this..
MessageQueue.Create(".\\" + QueueName,true);
Any help would be appreciated.