IBM Support

Error: The connection object is in auto-commit mode

Troubleshooting


Problem

"The connection object is in auto-commit mode" error appears while using JDBC

Symptom

An error "The connection object is in auto-commit mode" may occur while using the Netezza JDBC driver. This article describes how to avoid the problem.

Resolving The Problem

This issue is known to affect JDBC connections. Auto-commit mode indicates to the database whether to issue an automatic COMMIT operation after every SQL operation. By default, new connection objects are in auto-commit mode.

In auto-commit mode, the COMMIT operation occurs either when the statement completes or when the next execute occurs, whichever comes first. In the case of statements returning a ResultSet, the statement completes when the last row of the ResultSet has been retrieved or when the ResultSet has been closed. In more complex cases, a single statement can return multiple results as well as output parameter values. Here, the COMMIT occurs when all results and output parameter values have been retrieved.

However, you can disable auto-commit mode with a setAutoCommit(false) call. This mode requires that you manually commit or roll back groups of operations using the commit or rollback method of the connection object.

The following is an example of a JDBC connection string with auto-commit disabled and logging enabled:

"jdbc:netezza://192.168.23.226:5480/testdb;loglevel=2;AutoCommit=false;logDirPath=/myjdbclogdir";

[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

NZ016121

Document Information

Modified date:
17 October 2019

UID

swg21569239