When to set iscobol.jdbc.autocommit=false when using ESQL

Question ID : 148
Created on 2010-10-15 at 9:50 AM
Author : Veryant Support [support@veryant.com]

Online URL : http://support.veryant.com/support/phpkb/question.php?ID=148



isCOBOL ESQL is built upon JDBC, and the JDBC specification says that connections should (by default) be in 'autocommit' mode.
That means that every time a modification is made (whether it be INSERT, UPDATE or DELETE), the database is commited automatically.
That scenario is often what is required in plain Java, or COBOL applications.

However, there are some cases where it makes more sense for autocommit mode to be off, such as inside transaction processing environments or programs generated by Pro*COBOL or the DB2 preprocessor which doesn't work in autocommit mode by default.
You also may want to manage the number of commits in a large sequence of INSERT statements by limiting commits to every 1000 or so operations to improve performance.

To turn off autocommit, set this property:

   iscobol.jdbc.autocommit=false
If this variable is set to false, you are responsible for handling the transaction manually, with the COMMIT or ROLLBACK statement.

Back to Original Question