diff options
author | Bruce Momjian | 1998-10-08 00:38:21 +0000 |
---|---|---|
committer | Bruce Momjian | 1998-10-08 00:38:21 +0000 |
commit | 25b5faa7cdcb6c7cefc438bd5cd5e0141c7df0b4 (patch) | |
tree | fa71d2cc4884dd806806c501ed726de3a85b2b7a /src/interfaces/jdbc/postgresql/Connection.java | |
parent | 9042e9d757ecc9e83fc5888830764b3ed80b0702 (diff) |
Just a quick patch. This makes the JDBC driver thread safe, which is an
important step towards making the driver compliant, and means that for
some Java applications and servlets, only a single database connection
is
needed, so in a sence this is a nice little show stopper for 6.4 (and
should still be backward compatible to 6.3.2).
Peter
Diffstat (limited to 'src/interfaces/jdbc/postgresql/Connection.java')
-rw-r--r-- | src/interfaces/jdbc/postgresql/Connection.java | 6 |
1 files changed, 5 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); + } } /** |