471,605 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

New request is not allowed to start because it should come with valid transaction descriptor.

I have a C# windows service that uses MSMQ, DTC Transactions, SQL server
2005 and Notification services.

I am doing the following in the service:

OnStart
Create the queue
set the Peek Complete event
call Begin Peek

PeekComplete
WaitHandle[] waitHandle = new WaitHandle[] { new
AutoResetEvent(false) };
ThreadPool.QueueUserWorkItem(ProcessMessage, waitHandle[0])
Call End Peek
WaitHandle.WaiteAll(waitHandle)
queue.BeginPeek

ProcessMessage(object stateInfo)
AutoResetEvent are = (AutoResetEvent)stateInfo;
Create DTC Transaction
try
Message msg =
callResultQueue.Receive(MessageQueueTransactionTyp e.Automatic);
are.Set();
retreive Message Body
Using (SQLConnection conn = new SQLConnection(connectionString))
conn.open
Write Message Body to database

If Messagebody.Status = 20
Update Notification Services
Commit DTC transaction
catch
Roll Back DTC Transaction
Quite often I am receiving the above message, I've googled it and all I've
come up with is people asking how to solve the error. Any information would
be greatly appreciated. I know the above is mixed psudeo code with code, if
additional code is required please let me know, I'll provide what I can.

Thanks
Wayne
Jan 31 '06 #1
0 2964

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Frank Natoli | last post: by
18 posts views Thread by Chris Travers | last post: by
7 posts views Thread by Mike | last post: by
2 posts views Thread by Vivek Kumar | last post: by
reply views Thread by Joseph Geretz | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.