Re: Connection.setsavepoint() / releaseSavepoint() is not thread-safe - Mailing list pgsql-jdbc

From David G Johnston
Subject Re: Connection.setsavepoint() / releaseSavepoint() is not thread-safe
Date
Msg-id 1404739020449-5810741.post@n5.nabble.com
Whole thread Raw
In response to Re: Connection.setsavepoint() / releaseSavepoint() is not thread-safe  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc
Dave Cramer-8 wrote
> I don't think this is a JDBC issue. Rather a limitation of the postgresql
> server.

While my experience with other RDBMS is not that great I believe the
"limitation" belongs to the entire category and is probably a direct (or
indirect) result of the SQL standard.

Executing SQL commands is a linear process.  While some degree of command
execution parallelism is possible the user transaction itself is serial -
each command must end before the next command begins.  Thus the whole
premise of the parent/child setup is flawed.  If you try to have two child
threads working within a single parent transaction then by definition they
are going to be interfering with each other.

From the linked reference documentation:

"Multiple threads are permitted to share a Connection, Statement, or
ResultSet. However, the application programmer must ensure that one thread
does not affect the behavior of the others."

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Connection-setsavepoint-releaseSavepoint-is-not-thread-safe-tp5810588p5810741.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Connection.setsavepoint() / releaseSavepoint() is not thread-safe
Next
From: Dave Cramer
Date:
Subject: PostgreSQL JDBC new jar available