recoverInProgressEvents()

Recovers any In-Progress events in the event store.

Syntax

public abstract int recoverInProgress();

Parameters

None.

Return values

An integer that indicates the outcome status of the recovery operation. Compare this integer value with the following outcome-status constants to determine the status:

CWConnectorConstant.SUCCEED
The recovery of in-progress events succeeded.
CWConnectorConstant.FAIL
The recovery of in-progress events failed.

Exceptions

InvalidStatusChangeException
Thrown when the status is being changed to an invalid status value for the application.
StatusChangeFailedException
Thrown when the status change from IN_PROGRESS to READY_FOR_POLL fails.
AttributeNullValueException
Thrown if the InDoubtEvents connector configuration property is not defined and set.

Notes

The recoverInProgressEvents() method checks the event store for any events that currently have the IN_PROGRESS status. An event might remain in the event store with an event status of IN_PROGRESS if the connector was unexpectedly shutdown.

Note:
The CWConnectorEventStore class does not provide a default implementation for the recoverInProgressEvents() method. Therefore, the event-store class must implement this method to provide the ability to recover In-Progress events at connector startup.

One possible way to implement recoverInProgressEvents() is to base its actions on the InDoubtEvents connector configuration property. If such events exist, the method can take one of the following actions, based on the value of this property:

Value of InDoubtEvents Action for recoverInProgressEvents()
Reprocess Change all events with the IN_PROGRESS status to the READY_FOR_POLL status so that they are sent to the connector framework in subsequent poll calls.
FailOnStartup Log a fatal error and return a FAIL outcome status to agentInit(), which in turn throws the InProgressEventRecoveryFailedException exception. This action also sends an automatic email, if LogAtInterchangeEnd is set to True.
LogError Log a fatal error but do not return FAIL outcome status to agentInit().
Ignore Ignore the In-Progress events.

Note:
For recoverInProgressEvents() to work as described, the InDoubtEvents connector configuration property must be defined. If InDoubtEvents is not defined, recoverInProgressEvents() should throw the AttributeNullValueException exception.

The recoverInProgressEvents() methods is usually called as part of the connector initialization process, from within the agentInit() method. The agentInit() should check for the status from recoverInProgressEvents() and catch any exceptions as well. The agentInit() method should throw an exception in either of the following cases:

See also

agentInit()

Copyright IBM Corp. 1997, 2004