Backport patch to work around a server bug. Server incorrectly handles the
authorBarry Lind <[email protected]>
Wed, 19 Mar 2003 04:09:09 +0000 (04:09 +0000)
committerBarry Lind <[email protected]>
Wed, 19 Mar 2003 04:09:09 +0000 (04:09 +0000)
following:  select 1; commit; set autocommit true;
If this is submitted in one call to the server (the select 1 doesn't start a
new transaction like it should), however if the select 1 is sent as a separate
call then it works correctly.

Modified Files:
 Tag: REL7_3_STABLE
jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java

src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java

index a49b3fd1133c13bb184c7959e476ac1ae79db8c7..9448c183a092e92a1f5c81e73aa493ac37af376b 100644 (file)
@@ -939,7 +939,11 @@ public abstract class AbstractJdbc1Connection implements org.postgresql.PGConnec
                 //We do the select to ensure a transaction is in process
                                //before we do the commit to avoid warning messages
                                //from issuing a commit without a transaction in process
-                               ExecSQL("select 1; commit; set autocommit = on;");
+                               //NOTE this is done in two network roundtrips to work around
+                               //a server bug in 7.3 where the select wouldn't actually start
+                               //a new transaction if in the same command as the commit
+                               ExecSQL("select 1;");
+                               ExecSQL("commit; set autocommit = on;");
                        }
                        else
                        {