1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

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
This commit is contained in:
Bruce Momjian
1998-10-08 00:38:21 +00:00
parent 9042e9d757
commit 25b5faa7cd
4 changed files with 368 additions and 4 deletions

View File

@ -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);
}
}
/**