diff options
Diffstat (limited to 'src/interfaces/jdbc/postgresql')
-rw-r--r-- | src/interfaces/jdbc/postgresql/Connection.java | 6 | ||||
-rw-r--r-- | src/interfaces/jdbc/postgresql/fastpath/Fastpath.java | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/interfaces/jdbc/postgresql/Connection.java b/src/interfaces/jdbc/postgresql/Connection.java index 31f6e11980e..be15b38abe0 100644 --- a/src/interfaces/jdbc/postgresql/Connection.java +++ b/src/interfaces/jdbc/postgresql/Connection.java @@ -635,8 +635,11 @@ public class Connection implements java.sql.Connection * @return a ResultSet holding the results * @exception SQLException if a database error occurs */ - public synchronized ResultSet ExecSQL(String sql) throws SQLException + public ResultSet ExecSQL(String sql) throws SQLException { + // added Oct 7 1998 to give us thread safety. + synchronized(pg_stream) { + Field[] fields = null; Vector tuples = new Vector(); byte[] buf = new byte[sql.length()]; @@ -737,6 +740,7 @@ public class Connection implements java.sql.Connection if (final_error != null) throw final_error; return new ResultSet(this, fields, tuples, recv_status, 1); + } } /** diff --git a/src/interfaces/jdbc/postgresql/fastpath/Fastpath.java b/src/interfaces/jdbc/postgresql/fastpath/Fastpath.java index fdb68686554..ab702f457f2 100644 --- a/src/interfaces/jdbc/postgresql/fastpath/Fastpath.java +++ b/src/interfaces/jdbc/postgresql/fastpath/Fastpath.java @@ -68,6 +68,9 @@ public class Fastpath */ public Object fastpath(int fnid,boolean resulttype,FastpathArg[] args) throws SQLException { + // added Oct 7 1998 to give us thread safety + synchronized(stream) { + // send the function call try { // 70 is 'F' in ASCII. Note: don't use SendChar() here as it adds padding @@ -153,6 +156,7 @@ public class Fastpath throw new SQLException("Fastpath: protocol error. Got '"+((char)in)+"'"); } } + } } /** |