How can this be solved

G

Guest

Hi,
I have a service that collects messages form MSMQ to enter to a database.
What I notice is that if at the same time, during the process of sending the
queued message data to the database, I disconnect the cable, the data
obvoiusly don't go to the database but I happen to loose the queued message
it was currently inserting. Is there a way to perform a transaction on the
retrival of the queued message so that if anything breaks the process of
handling the queued message it simply returns the message to MSMQ queue?

Thanks
 
G

Guest

Hi,
Isn't this a transaction that is created by the application sending the
queued message and not the application reveiving the queued message? Will
double check I may be wrong.
 
G

Guest

You seem correct. I'll test. I see here the transaction is during the
receive. My app will begin processing to database after receipt. If the
connection breaks to the database would the current queue be rolled back?
 
G

Guest

Hi,
I am getting the error when I try to receive a transactional message from MSMQ

"The transaction usage is invalid"

I am using direct format names to send and receive the messages. Is that a
problem? Without transaction it works fine. Only when I enable transaction I
get the problem.

Thanks
 
B

Brendan Green

Make sure that the queue is a transactional queue (there is a checkbox when
creating a new queue).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top