Configurable transaction mode
Use the transaction mode to define whether job-related artifacts are called in global transaction mode or local transaction mode. Specify the transaction mode in the xJCL.
The following list describes the options for the com.ibm.websphere.batch.transaction.policy property.
- global
Specifies that all job-related artifacts including listeners, batch data streams, and checkpoint algorithms, are called in global transaction mode. This option is the default.
- local
- Specifies that all job-related artifacts including listeners,
batch data streams, and checkpoint algorithms, are called in local
transaction mode.
Updates to the local job status table and the database must be done through the same connection to maintain transaction integrity.
Transaction mode xJCL example
<job .....
...
<props>
<prop name="com.ibm.websphere.batch.transaction.policy" value="LOCAL"/>
</props>
....
java.sql.Connection conn = JobStepContextMgr.getContext().getSharedSQLConnection();
Do not attempt to create a JDBC connection or close a connection obtained with the job step context. Local transaction support is built into the batch data stream framework JDBC reader or JDBC writer patterns. Setting the com.ibm.websphere.batch.transaction.policy property to local forces the batch data stream framework to use the shared JDBC connection.