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


##########
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:
   I see, I understand now, it is this existing "setAutoCommit" call causing 
issues for certain jdbc provider. Yeah the existing code is not idea



-- 
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