Home » Developer & Programmer » JDeveloper, Java & XML » Max. open cursors exceeded by AQ enqueue/dequeue
Max. open cursors exceeded by AQ enqueue/dequeue [message #91937] Tue, 21 October 2003 09:57 Go to next message
Hanno Heine
Messages: 2
Registered: October 2003
Junior Member

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.

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?



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();
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
Re: Max. open cursors exceeded by AQ enqueue/dequeue [message #91944 is a reply to message #91937] Mon, 17 November 2003 22:17 Go to previous message
Messages: 104
Registered: October 2000
Senior Member
Hello Hanno,
I think ur not closing the connection once u receive the packets from queue n propagate to other queue.
looking into code i couldnt get much. But i am quite sure thats where u making a mistake.
Thanks n Regards,
Previous Topic: New starter trying to use Streaming
Next Topic: Doubt in Message Driven Bean(urgent)
Goto Forum:

Current Time: Sat Jul 31 16:30:33 CDT 2021