Hello,
I am trying to use System.Transactions and MSMQ with no success. In it is said:
"The System.Transactions infrastructure makes transactional programming simple and efficient throughout the platform by supporting transactions initiated in SQL Server, ADO.NET, MSMQ, and the Microsoft Distributed Transaction Coordinator (MSDTC)."
However, when I try to run an implicit transaction using Transaction Scope it does dont work. Here is my code:
using (TransactionScope scope = new TransactionScope())
{
using (MessageQueue myQueue = new MessageQueue(QUEUE_NAME))
{
if (myQueue.Transactional)
{
myQueue.Send(TicketTextBox.Text, "Message");
}
}
scope.Complete();
}
It compiles and runs but no message is sent, just as if no transaction were opened. I cannot try to use explicit transactions because MessageQueue does not implement EnlistTransaction(CommittableTransaction tx) method.
Please, is MSMQ aware of System.Transaction? How can I use it?
Thank you.
I am trying to use System.Transactions and MSMQ with no success. In it is said:
"The System.Transactions infrastructure makes transactional programming simple and efficient throughout the platform by supporting transactions initiated in SQL Server, ADO.NET, MSMQ, and the Microsoft Distributed Transaction Coordinator (MSDTC)."
However, when I try to run an implicit transaction using Transaction Scope it does dont work. Here is my code:
using (TransactionScope scope = new TransactionScope())
{
using (MessageQueue myQueue = new MessageQueue(QUEUE_NAME))
{
if (myQueue.Transactional)
{
myQueue.Send(TicketTextBox.Text, "Message");
}
}
scope.Complete();
}
It compiles and runs but no message is sent, just as if no transaction were opened. I cannot try to use explicit transactions because MessageQueue does not implement EnlistTransaction(CommittableTransaction tx) method.
Please, is MSMQ aware of System.Transaction? How can I use it?
Thank you.