[libpostgresql-jdbc-java] 12/22: Backport patch to work around a server bug. Server incorrectly handles the 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.

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:19:03 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to tag REL7_3_4
in repository libpostgresql-jdbc-java.

commit 9360e6e5be7ab1432c80685a17b8a2bdbcc99a94
Author: Barry Lind <barry at xythos.com>
Date:   Wed Mar 19 04:09:09 2003 +0000

    Backport patch to work around a server bug.  Server incorrectly handles the
    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
---
 org/postgresql/jdbc1/AbstractJdbc1Connection.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/org/postgresql/jdbc1/AbstractJdbc1Connection.java b/org/postgresql/jdbc1/AbstractJdbc1Connection.java
index a49b3fd..9448c18 100644
--- a/org/postgresql/jdbc1/AbstractJdbc1Connection.java
+++ b/org/postgresql/jdbc1/AbstractJdbc1Connection.java
@@ -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
 			{

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list