cwashcraft commented on code in PR #32988:
URL: https://github.com/apache/beam/pull/32988#discussion_r1828558709


##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -1575,10 +1629,15 @@ private Connection getConnection() throws SQLException {
     public void processElement(ProcessContext context) throws Exception {
       // Only acquire the connection if we need to perform a read.
       Connection connection = getConnection();
+
       // PostgreSQL requires autocommit to be disabled to enable cursor 
streaming
       // see 
https://jdbc.postgresql.org/documentation/head/query.html#query-with-cursor
-      LOG.info("Autocommit has been disabled");
-      connection.setAutoCommit(false);
+      // This option is configurable as Informix will error
+      // if calling setAutoCommit on a non-logged database
+      if (disableAutoCommit) {
+        LOG.info("Autocommit has been disabled");
+        connection.setAutoCommit(false);

Review Comment:
   While I agree with your statement, this setAutoCommit statement has already 
been present in the code for some time. This PR is only making it conditional. 
Removing it entirely would bring a breaking change.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to