How can this be solved

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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?
 
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
 
Make sure that the queue is a transactional queue (there is a checkbox when
creating a new queue).
 
Back
Top