Previous Next Contents Index


IOrder interface (deprecated)

IOrder is deprecated and is provided for backward compatibility only. New applications developed according to the servlet-JSP programming model do not need the functionality provided by IOrder.

The IOrder interface represents the current processing status of an asynchronous operation. IOrder provides methods for obtaining the status and return code of an asynchronous operation.

To run an asynchronous database operation, the AppLogic must specify GX_DA_EXECUTEQUERY_FLAGS.GX_DA_EXEC_ASYNC as the flags parameter in any of the following methods:

To create an instance of the IOrder interface for an asynchronous query, use getOrder( ) in the IResultSet interface (deprecated), as shown in the following example:.

IResultSet rs;

IOrder ord
ord=rs.getOrder();
Package
com.kivasoft

Methods
getState( )
Returns the processing status of the asynchronous operation on the database server: active, done, canceled, or unknown.

Related Topics
executeQuery( ) in the IDataConn interface (deprecated)

getOrder( ) in the IResultSet interface (deprecated)

GX.WaitForOrder( )

getState( )
Returns the processing status of the asynchronous operation.

Syntax
public getStateIOrder getState()
Usage
Use getState( ) to return status information to use in error-handling code.

Return Value
A getStateIOrder object with three variables, each containing status and result code values. The three variables are described in the following table:

Variable
Description
pdwState
Contains one of the following status codes:
pdwResult
Contains the result code of an asynchronous database operation when the operation is done or canceled.
pGuess
Contains the estimate about the current completion percentage of the operation.

Example
Orders[] = new IOrder[1];

int nOrder;

Orders[0] = newRequestAsync(asyncGUIDStr, valIn, valOut);
if (Orders[0] != null)
{
log("Successfully invoked async AppLogic\n");

// wait for async applogic to finish (max 100 seconds)
nOrder = GX.WaitForOrder(Orders, context, 100);
if (nOrder >= 0)
{
return result("Error in executing async request:
order wait returned an error");
}
else
{
getStateIOrder state = Orders[0].getState();
if (state == null || state.pdwResult != GXE.SUCCESS)
return result("Error in executing async
request");
}
}
else
{
log("Failed to invoke async AppLogic\n");
}
Related Topics
executeQuery( ) in the IDataConn interface (deprecated)

getOrder( ) in the IResultSet interface (deprecated)

GX.WaitForOrder( )

 

© Copyright 1999 Netscape Communications Corp.