z/OS Batch Runtime Planning and User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Java function for commit and rollback

z/OS Batch Runtime Planning and User's Guide
SA23-1376-00

The following class contains commit and rollback functions for Java™ applications:
com.ibm.batch.spi.UserControlledTransactionHelper
The class contains the following static methods that initiate the commit or rollback process:
Commit
UserControlledTransactionHelper.commit()
Rollback
UserControlledTransactionHelper.rollback()

z/OS Batch Runtime uses z/OS® Resource Recovery Services (RRS) to manage the unit of work that is active across the PL/I, COBOL, and Java language boundary. All commits and rollbacks must be managed by z/OS Batch Runtime; your applications should not call commit and rollback directly. Rather, they should use helper functions to call the functions. When your Java application needs to perform a commit or rollback, you must call these helper functions to perform the function. For COBOL applications, you can use the COBOL INVOKE statement to invoke these helper methods.

Direct use of JTA (Java transaction API) by Java programs is not allowed. Also, any use of SQL COMMIT or ROLLBACK APIs by Java or COBOL will be rejected with SQLSTATE = '2D521 SQL COMMIT or ROLLBACK are invalid in the current operating environment'. As such, Java programs should avoid setting the JDBC autocommit connection option. See Code examples for examples.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014