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

  • What is my operating system in regards to my printer installation?

    When trying to install the drivers and software for your printer from the HP website, it is required to know both your operating system and your system type. To determine if you have Windows or Mac, below is the icon you will find that is often refer

  • What is a business area???

    hi experts explain me wat is a business area. thanks Neha

  • VC iviews as callable object

    Hi I want to make iview as callable object .But I am unable ti get that iview in my guided procedure what is the proces to make iviews available as object in guided procedure.

  • My Leopard DVD is damaged

    Hi, My first language is spanish, so please excuse any grammar mistakes. I've bought a Macbook White on April/2008, and it came with 2 Discs of "Mac OSX Install". and a DVD of "Mac OS X Leopard", but for some reason my Leopard DVD is damaged and does

  • Why can not open another Linux OS?

    What is the symbol "*" stand for in the follow documant? [root@localhost frank]# fdisk -l Disk /dev/sda: 40.0 GB, 40007761920 bytes 255 heads, 63 sectors/track, 4864 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x395f39