134 WebSphere Business Integration Adapters
Table 8-20 Method for releasing event-store resources
For example, if the event store is implemented as event tables in a database, the
pollForEvents() method might allocate SQL cursors to access these tables.
You can implement a cleanupResources() method to free these SQL cursors. At
the end of pollForEvents(), you can then call the cleanupResources() method
to free the memory that these cursors use.
8.5 Processing delete events
An application can support one of the following types of delete operations:
Physical delete (data is physically deleted from the database).
Logical delete (a status column in a database entity is set to an inactive or
invalid status, but the data is not deleted from the database).
It might be tempting to implement delete event processing in a manner that is
consistent with the application. For example, when an application entity is
deleted, a connector poll method for an application that supports physical deletes
might publish a business object with the Delete verb. A connector poll method for
an application that supports logical deletes might publish a business object with
the Update verb and the status value changed to inactive.
Problems can arise with this approach when a source application and a
destination application support different delete models. Suppose that the source
application supports logical delete and the destination application supports
physical delete. Assume that an enterprise is synchronizing between the source
and destination applications. If the source connector sends a change in status (in
other words, a delete event) as a business object with the Update verb, the
destination connector might be unable to determine that the business object
actually represents a delete event.
Therefore, event publishing must be designed so that source connectors for both
types of applications can publish delete events in such a way that destination
connectors can handle the events appropriately. The Delete verb in an event
notification business object should represent an event where data was deleted,
Java connector library class Method
CWConnectorEventStore cleanupResources()
Note: The CWConnectorEventStore class does not provide a default
implementation of the cleanupResources() method. To free event-store
resources, you must override the cleanupResources() method with a version
that releases the resources needed to access your event store.