informix
INFORMIX-ESQL/C Programmer's Manual
ESQL/C Function Library

sqlbreakcallback()

The sqlbreakcallback() function allows you to specify a time-out interval and to register a callback function. The callback function provides a method for the application to regain control when the database server is processing an SQL request.

Warning: Do not use the sqlbreakcallback() function if your ESQL/C application uses shared memory (olipcshm) as the nettype to connect to an Universal Server database server. Shared memory is not a true network protocol and does not handle the non-blocking I/O that is needed to support a callback function. When you use sqlbreakcallback() with shared memory, the call appears to register the callback function successfully (it returns zero); however, during SQL requests, the application never calls the callback function.

Syntax

Usage

Once you register a callback function with sqlbreakcallback(), the application calls this function at three different points in the execution of an SQL request. The value in the status argument of the callback function indicates the point at which the application calls the function. The following table summarizes the status values.

When Callback Function Is Called Value of status
Argument
When the database server begins processing an SQL request status = 1
While the database server executes an SQL request, when the time-out interval has elapsed status = 2
When the database server completes the processing of an SQL request status = 0

When you call the callback function with a status value of 2, the callback function can determine whether the database server can continue processing with one of following actions:

The callback function, and any of its subroutines, can contain only the following ESQL/C control functions: sqldone(), sqlbreak(), and sqlbreakcallback(). For more information about the callback function, see page 12-38.

If you call sqlbreakcallback() with a time-out value of zero (0), the callback function executes immediately. The callback function executes over and over again unless it contains a call to sqlbreakcallback() to redefine the callback function with one of the following actions:

For more information about the time-out interval, see page 12-38.

You must establish a database server connection before you call the sqlbreakcallback() function. The callback function remains in effect for the duration of the connection or until the sqlbreakcallback() function redefines the callback function.

Return Codes

0 The call to sqlbreakcallback() was successful.
<0 The call to sqlbreakcallback() was not successful.


INFORMIX-ESQL/C Programmer's Manual, Version 9.21
Copyright © 1999, Informix Software, Inc. All rights reserved