Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: implementing a messaging queue through the database.

Re: implementing a messaging queue through the database.

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 24 Mar 2002 13:02:57 -0800
Message-ID: <a7leu1061b@drn.newsguy.com>


In article <ce3f1689.0203240401.41cf3a7_at_posting.google.com>, eran_at_prosight.com says...
>
>Hi !
>
>I am trying to implement a messaging queue, with multiple readers and
>writers through the database. I want to implement it without any
>locks.
>
>The writers add entries with the sequence column.
>My problem is with the readers : I don't want each reader to read
>again messages it read on the last time.
>The sequence index is not helping me, because if I read messages
>1,2,3,4,6 I have no idea if I will have to read '5' in the future
>(because the transaction writing it didn't end), or the transaction
>was aborted and it will never appear.
>
>Because of that reason, I must read all messages the next time I want
>to read, and keep an internal read what I've read before.
>
>THERE MUST BE A MORE ELEGANT WAY DOING IT.
>

sure is -- called AQ, part of the database already, you don't need to rewrite it.

http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.817/a76938/toc.htm ....

>Please advice ....
>
>Eran

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Sun Mar 24 2002 - 15:02:57 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US