When to set iscobol.jdbc.autocommit=false when using ESQL
Estimated Reading Time: 1 Minutes
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=falseIf this variable is set to false, you are responsible for handling the transaction manually, with the COMMIT or ROLLBACK statement.