Some of the messages aren't dequeued using JMS/AQ

Hi.
I am having strange problems dequeuing messages from an Oracle9i Release 2 database. I have a trigger that sends a message everytime a table is updated. When I have SQL worksheet and update the table through a SQL statement then I only recieve about 50-70% of the events. When I use Oracle Enterprise Manager Console I can see the rest of the messages are lying in the queue as 'READY'.
I need this to be VERY reliable so if anyone have any ideas I would really appreciate it. I used PL/SQL in the DB because of the speed increase but maybe a Java Stored Procedure will work better? I have included the code in question below.
Best regards
Christer Nordvik
JAVA code
//get a DB connection to use with JMS
dbconn = prevision.database.DBPool.getConnection();
//try to estabilish a connection to the JMS server to recieve alarm updates
tconn = AQjmsTopicConnectionFactory.createTopicConnection(dbconn);
/* Create a Topic Session */
tsess = (AQjmsSession)tconn.createTopicSession(true, Session.DUPS_OK_ACKNOWLEDGE);
tconn.start();
topic = ((AQjmsSession)tsess).getTopic("TS",strTopic) ;
tsub1 = tsess.createDurableSubscriber(topic, "T");//unique id
while (!done)
//waits forever
logger.debug("Waiting for alarms...");
dtxtmsg = (TextMessage)(tsub1.receive());
//found a message
logger.debug("Recieved alarm " + dtxtmsg.getText());
PL/SQL code
AS
BEGIN
DECLARE
Enqueue_options DBMS_AQ.enqueue_options_t;
Message_properties DBMS_AQ.message_properties_t;
Message_handle RAW(16);
User_prop_array SYS.AQ$_JMS_USERPROPARRAY;
Agent SYS.AQ$_AGENT;
Header SYS.AQ$_JMS_HEADER;
Message SYS.AQ$_JMS_TEXT_MESSAGE;
Message_text VARCHAR2(100);
gt1 number;
BEGIN
Message_properties.expiration := 3600; --Set the time to live for the message
gt1:= DBMS_UTILITY.GET_TIME;
Agent := SYS.AQ$_AGENT('',NULL,0);
User_prop_array := SYS.AQ$_JMS_USERPROPARRAY();
Header := SYS.AQ$_JMS_HEADER( Agent, '', 'aq1', '', '', '', User_prop_array);
Message_text := 'Message 1 from PL/SQL';
Message := SYS.AQ$_JMS_TEXT_MESSAGE(Header, LENGTH(Message_text), Message_text, NULL);
--setting the id of the sender
Message_properties.correlation := 'tst';
--Message_properties.correlation := gt1;         
DBMS_AQ.ENQUEUE(queue_name => 'ts.tstopic',
Enqueue_options => enqueue_options,
Message_properties => message_properties,
Payload => message,

I figured it out. Was something wrong with the trigger in the DB...

Similar Messages

Maybe you are looking for

  • New Network Infrastructure Design and Architecture Community

    All, I'm pleased to announce our new Network Infrastructure Design and Architecture Community.  In this community we encourage everyone to share their knowledge and start conversations on design and overall network topology. All topics are welcome, i

  • Sudden G5 Display Issues!

    Somewhat similar to another previous post from another member, I was using my tower model G5 (2003?) and suddenly my display showed a checkerboard pattern that began flickering. I shut it down and re-booted; same thing. I let it sit for a day and sta

  • Can i turn off icon labels in Symbian ^3 on my N8?

    just updated my N8 from anna to belle and my first inclination is to turn off what was originally called tool tips, or the superfluous labels underneath each icon in the GUI.  i mean isn't that what the G stands for - Graphical?  the Nokia representa

  • Is there a way to import my bookmarks and passwords from my desktop to my new laptop?

    Beyond printing it out, and logging in to every website? I'm looking for a feature similar to sending your contact info from an old cell to a new one with Bluetooth.

  • How to download & convert .f4f video streaming files into flv/mp4 files

    Below is the website for which I am asking this query http://www.startv.in/show/devon-ke-dev-mahadev/352 These are .f4f videos which I can view online. I am not able to download & play them in their original format. I also would like to download & pl