summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarry Lind <barry@xythos.com>2003-03-19 04:09:09 +0000
committerBarry Lind <barry@xythos.com>2003-03-19 04:09:09 +0000
commite02ace4418026de395ae8458d39ce21b251a518b (patch)
treee08ffe9a73264914b88c989ada90c6c6cbde5cea /src
parentd10ed0263e30215875c28c00598949643de78959 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
index 76e31379610..c6a6fab27d3 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
@@ -14,7 +14,7 @@ import org.postgresql.largeobject.LargeObjectManager;
import org.postgresql.util.*;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.12.2.1 2002/11/14 05:54:39 barry Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.12.2.2 2003/03/19 04:09:09 barry Exp $
* This class defines methods of the jdbc1 specification. This class is
* extended by org.postgresql.jdbc2.AbstractJdbc2Connection which adds the jdbc2
* methods. The real Connection class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Connection
@@ -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
{