Consultor Eletrônico



Kbase P140616: 4GL/ABL: Error 2732 running an application
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/30/2009
Status: Unverified

SYMPTOM(s):

4GL/ABL: Error 2732 running an application

qrNext called with a closed query. (2732)

New 4GL/ABL clients' connections to the database are rejected.

4GL/ABL clients attempting to connect to the database after the error 2732 occurs silently fail.

FACT(s) (Environment):

All Supported Operating Systems
OpenEdge 10.x

CAUSE:

This is a system error - PROGRESS issued a GET request with a query ID that does not refer to an open query. This is not fatal, but the request cannot be processed. The limit on the database server's available list of open dynamic queries is 16384. Once this limit is reached, the server rejects any new connections.

The cause of this error is usually an application logic error that allows an infinite loop to continuously CREATE, PREPARE, OPEN and GET-NEXT() dynamic queries without properly handling the possible STOP condition that may be raised by this error.

When a module of a 4GL/ABL application goes into an infinite loop and continuously does dynamic query CREATE, PREPARE, OPEN and GET-NEXT() in each iteration without deleting these queries, eventually it will reach the limit allowed by the database server for open dynamic queries and generate the error: qrNext called with a closed query. (2732).

From that point on, the database server will reject any attempt to connect to it and all 4GL/ABL clients attempting to connect to it will silently die as long as the offending infinite loop procedure is running.

The offending infinite loop procedure will keep running until it runs out of resources and terminate abnormally. Only at that point, can the database base server accept new client connections.

FIX:

Ensure that the STOP condition raised by the above error is properly handled and that no infinite loop is allowed to continuously CREATE, PREPARE, OPEN and GET-NEXT() dynamic queries without properly handling the possible STOP condition that may be raised by this error.
In the npotes below, the procedure InfiniteLoopGenerating(2732).p is an example of how this problem may arise when the STOP condition is not properly handled. Also, the procedure CleanUpAfterError(2732).p is an example of how to properly handle the STOP condition.
A key items to note in this situation is the need to properly close and delete the open dynamic queries as soon as they are no longer needed. This is done in the sample code below in the CleanQueryAndBufferObjects internal procedure using the 4GL/ABL statements:
CurrentQueryHandle:QUERY-CLOSE(). /* CLOSE the current open query */
DELETE OBJECT CurrentQueryHandle. /* DELETE the open query object */