Batch data streams (BDS) are Java objects that provide an abstraction for the data stream processed by a batch step. A batch step can have zero or more BDS objects associated with it. The long-running execution environment make the BDS associated with the batch step available at run time. The long-running execution environment also manages the lifecycle of a BDS by invoking batch-specific callbacks.
A BDS object implements the com.ibm.websphere.batch.BatchDataStream interface. This interface is server agnostic. The implementing object can retrieve data from any type of data source, for example, files, databases, and so on. Callback methods on the BatchDataStream interface allow the long-running execution environment to manage the BDS at run time. One of the key features of a BDS is its capability to convey its current position in the stream to the long-running execution environment, and the capability to position itself to a given location in the data stream. This feature allows the long-running execution environment to record (in the long-running execution environment database) how much data a batch step has processed. This information is recorded on every checkpoint. Therefore, the long-running execution environment can restart a batch job from a recorded position in the data stream if the job is canceled or fails in a recoverable manner.
The following main methods exist for the BatchDataStream interface. See the API for the BatchDataStream interface for additional information.
The BatchDataStream interface does not have methods for retrieving or writing data. There are no getNextRecord and putNextRecord methods defined on the interface that a batch step calls to read or write to the BDS object. Methods for passing data between the batch step and the BDS object are left up to the implementation of the BDS object. Review the batch Samples that this product supports to see examples of how to implement batch data streams.
Transaction environment
All methods of a BDS object are called in a global transaction. There is no guarantee that any consecutive method calls made to a BDS object happen in the same transaction because the transaction is owned by the long-running execution environment, not the BDS object.