473,324 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How can this be solved

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
Oct 19 '05 #1
6 4235
See:
System.Messaging.MessageQueueTransaction

"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
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

Oct 19 '05 #2
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.

"Brendan Green" wrote:
See:
System.Messaging.MessageQueueTransaction

"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
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


Oct 19 '05 #3
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?

"Brendan Green" wrote:
See:
System.Messaging.MessageQueueTransaction

"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
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


Oct 19 '05 #4
Yes.

A snippit of what I did for a client:

----------------------------------
messageQueueTran = new System.Messaging.MessageQueueTransaction();message QueueTran.Begin();//Tryto get a message from the queue. Set the timeout to the value provided. myMessage = messageQueue.Receive(new TimeSpan(0, 0, m_timeout), messageQueueTran);// Do some processing// if processed okmessageQueueTran.Commit();----------------------------------
If there was a problem, we'd call mnessageQueueTran.Abort(), which would put the message back on the queue.

"Chris" <Ch***@discussions.microsoft.com> wrote in message news:A3**********************************@microsof t.com...
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?

"Brendan Green" wrote:
See:
System.Messaging.MessageQueueTransaction



"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
> 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



Oct 20 '05 #5
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

"Brendan Green" wrote:
Yes.

A snippit of what I did for a client:

----------------------------------
messageQueueTran = new System.Messaging.MessageQueueTransaction();message QueueTran.Begin();//Try to get a message from the queue. Set the timeout to the value provided. myMessage = messageQueue.Receive(new TimeSpan(0, 0, m_timeout), messageQueueTran);// Do some processing// if processed okmessageQueueTran.Commit();----------------------------------
If there was a problem, we'd call mnessageQueueTran.Abort(), which would put the message back on the queue.

"Chris" <Ch***@discussions.microsoft.com> wrote in message news:A3**********************************@microsof t.com...
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?

"Brendan Green" wrote:
See:
System.Messaging.MessageQueueTransaction

"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
> 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

Oct 26 '05 #6
Make sure that the queue is a transactional queue (there is a checkbox when
creating a new queue).

"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:59**********************************@microsof t.com...
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

"Brendan Green" wrote:
Yes.

A snippit of what I did for a client:

----------------------------------
messageQueueTran = new
System.Messaging.MessageQueueTransaction();message QueueTran.Begin();//Try
to get a message from the queue. Set the timeout to the value provided.
myMessage = messageQueue.Receive(new TimeSpan(0, 0, m_timeout),
messageQueueTran);// Do some processing// if processed
okmessageQueueTran.Commit();----------------------------------
If there was a problem, we'd call mnessageQueueTran.Abort(), which would
put the message back on the queue.

"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:A3**********************************@microsof t.com...
> 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?
>
> "Brendan Green" wrote:
>
>> See:
>> System.Messaging.MessageQueueTransaction
>>
>>
>>
>> "Chris" <Ch***@discussions.microsoft.com> wrote in message
>> news:60**********************************@microsof t.com...
>> > 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
>>
>>
>>

Oct 27 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Eric | last post by:
Hello, I created a form to upload files. The formfield contents are stored as records in an Ascii file "data.dat"; for reasons I am not using a MySql database. The upoaded file itself is stored...
2
by: Bruce A. Julseth | last post by:
What am I doing wrong? Do I have something set up (config file, et.al) wrong? The following is the senerio: Login as: mysql -u root Run cmd: grant all on * to fred identified by 'julebj';...
2
by: Martin | last post by:
Hello, For testing purpose, I'm trying to use RMI... Here is the exception when I run Main.java : Exception in thread "main" java.security.AccessControlException: access denied...
1
by: Vincent Montressor | last post by:
I'm playing around with writing my own panel applets, and I'm trying to figure out how to get my panel applets to be restored when I log in. As an experiment, I'm using the simple clock applet...
0
by: Jeff Hagelberg | last post by:
I solved the problem. I needed use -Qoption,link,-export-dynamic.
3
by: Richard Muller | last post by:
Hi All, I've got the ASP script shown below that complains as follows: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Data source name not found and no default driver specified...
28
by: joe | last post by:
I have a simple .NET application with two or three listViews which are filled with icons and when the user click on the proper item, they display the related images. I use "image = null ; " for all...
9
by: GL | last post by:
I am running DB2 8.1.1 on AIX 5.1 Having a problem with a redirected restore. Once into the restore continue phase, I immediately get the following “SQL2059W A device full warning was...
19
by: Mountain | last post by:
I would like opinions on whether this solution could be important and whether anyone knows if it is already solved. (I would also like to know if anyone thinks it cannot be solved.) First, we...
4
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi All, Our company is merging two production domains(from two different servers) onto one server. So during the migration we use an intranet testing server to hold all files from these two...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.