AUTO_ACKNOWLEGE still may deliver same message twice
Sam Gehouse
Ranch Hand
Joined: Jul 21, 2003
Posts: 281
posted
0
Yes it does Sam. However it might not be always possible and sometimes the same message could be redelivered. With AUTO_ACKNOWLEGE mode for example, there is a small gap between the time the message was received and the moment of acknowledgement. If the application fails exactly within that gap, then because the message was delivered, but the acknowledge message wasn�t received (and therefore the message is not removed from the queue) it will be received again next time. Regards.
--------------------
I think, therefore I exist -- Rene Descartes Posts: 171 | Registered: Feb 2005 | IP: Logged Sam Gehouse ranch hand Member # 53366
posted April 07, 2005 09:35 AM Profile for Sam Gehouse Email Sam Gehouse Send New Private Message Edit/Delete Post Reply With Quote As you said: If the application fails exactly within that gap, then because the message was delivered, but the acknowledge message wasn�t received (and therefore the message is not removed from the queue) it will be received again next time.
Is there a solution to that? In other words, what could be the preferred solution so that the message is NOT delivered MORE than ONCE and ONE TIME ONLY. Regards, SG
Valentin Tanase
Ranch Hand
Joined: Feb 17, 2005
Posts: 704
posted
0
One obvious solution would be to use another acknowledge mode, like DUPS_OK_ACKNOWLEDGE. Another solution would be to use transacted sessions, which will ignore the acknowledge modes and will help developers to define units of work (transactions). Finally one must use appropriate try/catch blocks in order to avoid application failures. Regards.