473,400 Members | 2,163 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,400 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 4243
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.