This procedure cancels a given activity. If the cancel
takes place, an error message will be returned to the application
that submitted the activity that was cancelled.
Syntax
>>-WLM_CANCEL_ACTIVITY--(--application_handle--,--uow_id--,--activity_id--)-><
The schema is SYSPROC.
Procedure parameters
- application_handle
- An input argument of type BIGINT that specifies the application
handle whose activity is to be cancelled. If the argument is null,
no activity will be found and an SQL4702N with SQLSTATE 5U035 is returned.
- uow_id
- An input argument of type INTEGER that specifies the unit of work
ID of the activity that is to be cancelled. If the argument is null,
no activity will be found and an SQL4702N with SQLSTATE 5U035 is returned.
- activity_id
- An input argument of type INTEGER that specifies the activity
ID which uniquely identifies the activity within the unit of work
that is to be cancelled. If the argument is null, no activity will
be found and an SQL4702N with SQLSTATE 5U035 is returned.
Authorization
One of the following authorities is required to execute the routine:
- EXECUTE privilege on the routine
- DATAACCESS authority
- DBADM authority
- SQLADM authority
- WLMADM authority
Default PUBLIC privilege
None
Example
An administrator can use the WLM_GET_WORKLOAD_OCCURRENCE_ACTIVITIES
table function to find the application handle, unit of work ID and
activity ID of an activity. To cancel an activity with application
handle 1, unit of work ID 2 and activity ID 3:
CALL WLM_CANCEL_ACTIVITY(1, 2, 3)
Usage notes
- If no activity can be found, an SQL4702N with SQLSTATE 5U035 is
returned.
- If the activity cannot be cancelled because it not in the correct
state (not initialized), an SQL4703N (reason code 1) with SQLSTATE
5U016 is returned.
- If the activity is successfully cancelled, an SQL4725N with SQLSTATE
57014 is returned to the cancelled application.
- If, at the time of the cancel, the coordinator is processing a
request for a different activity or is idle, the activity is placed
into CANCEL_PENDING state and will be cancelled when the coordinator
processes the next request.