From 25b5faa7cdcb6c7cefc438bd5cd5e0141c7df0b4 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 8 Oct 1998 00:38:21 +0000 Subject: 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 --- src/interfaces/jdbc/postgresql/fastpath/Fastpath.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/interfaces/jdbc/postgresql/fastpath/Fastpath.java') 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)+"'"); } } + } } /** -- cgit v1.2.3