Batch operations

Note: The behavior of Batch operations is directly dependent on the support provided by the JDBC drivers of the respective Database vendors. Ensure that you pay attention to any note that describes a behavior specific to a database type.

Batch operations are provided as high performance solutions to insert/update a large number of records in the database, or delete a large number of records from the database.

A Batch operation accepts a list of business objects and processes the top-level business objects in a batch mode (Hierarchical business objects with child business objects is currently not supported). Batch operations include BatchCreate, BatchUpdate, and BatchDelete. For more information, see BatchCreate operation, BatchUpdate operation, and BatchDelete operation.

Input Business Object

The figure displays an example of an input business object for a Batch operation.

The input business object contains of a list of business objects (For example, CustomerList).

Returned Business Object

The figure displays an example of a returned business object (BatchResult Business Object) for a Batch operation.

The BatchResult Business Object contains a list of business objects (businessobjects), update counts (affectedrowcounts), and error messages (errormessages), which are explained below.

businessobjects

It contains a list of the returned result business object. In most cases, it is the same as the input business object. But, if there are sequence UIDs or CopyAttributes ASIs configured to the properties of the input business object, the updated business object will be returned.

The result business objects are returned by default. You can configure the adapter not to return the result business objects by appropriately setting the value of the returnBOsInBatch interaction property.

affectedrowcounts

Indicates the number of records affected in the database. This is returned by the database drivers. So, the values displayed here depends on the conventions used by different drivers.

Table 1. Description of affectedrowcounts
Value Description
0 Indicates that no records are affected (The adapter views this as a record not found exception).
1 Indicates that only one record is affected (expected result).
-2 Indicates that the batch statement was successfully executed, but the count of the number of rows affected is unavailable.
-3 Indicates that the Batch operation failed to execute. The detailed error message can be found in the corresponding errormessages field. The error messages returned depends on the database driver. For example, the MS SQL Server database might return only the first exception message for a record that failed.
-99998 Indicates that the business object was skipped unexpectedly. This is adapter-specific. The error message is probably unavailable. For further assistance, contact WebSphere® Adapters Support.
-99999 Indicates an invalid input, which is adapter-specific. An internal exception or unknown exception is thrown. The details of the error message can be found in the corresponding errormessages field.

errormessages

Indicates the detailed error message of the corresponding input business object.

Note:
  • Hierarchical business objects are not supported in these Batch operations.
  • The adapter does not ensure execution order of the input business objects, in order to maximize performance.
  • The adapter does not automatically generate Fault Binding for Batch operations.
  • There is no relationship between Batch operations (BatchCreate, BatchUpdate, and BatchDelete) and Batch Business Object. Batch operations are applicable when processing a large amount of business data and Batch Business Object is applicable when processing multiple user-defined SQL statements.
  • AutoCommit is not supported in Batch operations. Therefore, if there are Batch operations defined, the Auto commit (AutoCommit) property must be set to false in the outbound interface. If AutoCommit = True, an exception is thrown.

Exception Handling

When errors occur during Batch operations, the skipErrorsInBatch (default value is false) option can be used to configure how to handle such errors.




Feedback

(C) Copyright IBM Corporation 2005, 2012. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)