Max. open cursors exceeded by AQ enqueue/dequeue [message #91937] |
Tue, 21 October 2003 09:57 |
Hanno Heine
Messages: 2 Registered: October 2003
|
Junior Member |
|
|
Hello,
I have a very simple Java app that dequeues raw messages from one queue and propagates that message into one out of several other queues, based on the message content.
Presently the app just propagates into the same queue, so it merely moves messages from one queue into the other.
The source code of the app is given below.
Problem:
The app works all right for some 600 messages, with about 400 bytes each, and then ends with error:
ORA-01000 maximum open cursors exceeded
I did not find any errors in using the AQ API, my code corresponds to common examples. Since I only call the dequeue/enqueue methods I cannot open/close statements myself.
Looking into v$open_cursors suggest that many cursors are opened by the AQ API, in procedure dbms_aqin.aq$_enqueue_raw_no_recpl().
I cannot imagine that increasing the max. number of open cursors helps...
Does anybody have an idea?
Thanks
Hanno
------------------------------------
Here is the source code:
// Main loop:
while (true)
{
String tel = TelComSpsMain.deQueueRawMsg();
String schema = tel.substring(1, 4); // Pick schema for target queue
TelComSpsMain.enQueueRawMsg(tel, schema, null);
}
public static String deQueueRawMsg()
throws AQException, SQLException
{
AQMessage message = myQueueFromSps.dequeue(deqOption); // Options: DEQUEUE_REMOVE and NAVIGATION_NEXT_MESSAGE
AQRawPayload rawPayload = message.getRawPayload();
DBCon.getConnection().commit();
return new String(rawPayload.getBytes());
}
public static void enQueueRawMsg(String strMsg, String schema, String nameQueueToSps)
throws AQException, SQLException
{
AQQueue queue = aqSession.getQueue("FLS", nameQueueToSps);
AQMessage aqMsg = queue.createMessage(); // Creating a message to contain raw payload
byte[[]] bytesMsg = strMsg.getBytes();
AQRawPayload rawPayload = aqMsg.getRawPayload();
rawPayload.setStream(bytesMsg, bytesMsg.length);
queue.enqueue(enqOption, aqMsg); // Only default options
DBCon.getConnection().commit();
}
|
|
|
|