Guten Tag Lukas Eder,
am Montag, 8. Juni 2020 um 17:41 schrieben Sie:

> JDBC Connections cannot be shared among threads.[...]

Is that more like a suggestion based on your experience or a hard
technical fact?

I didn't find hard facts yet, only advises and arguments that I do
understand in a away that sharing is at least partly supported.

The docs I provided read to me very JDBC-generic, not Derby specific.
Others use shared connections as well, it's only slower than
originally assumed because of synchronization.

https://stackoverflow.com/a/52798543/2055163

I'm sharing connections right now in my app and things work, with the
one caveat that performance is not as originally expected. So I don't
get really concurrent execution of independent statements using the
same connection. But things don't arbitrarily fail as well.

> Are you using Derby?

No, I had the feeling those docs are for JDBC in general.

> I'm not sure about Derby, but yes, you can re-use a
> pooled connection *sequentially*, but no *in parallel*. In most cases, two
> threads should never share a JDBC Connection.

There's the following sentence in the docs I provided:

> Committing or rolling back a transaction closes all open ResultSet
> objects and currently executing Statements, unless you are using
> held cursors.

https://docs.oracle.com/javadb/10.8.3.0/devguide/cdevconcepts89498.html

"ResultSet" and "Statement" is referred to in plural. Why is that not
implying parallel usage of the underlying connection? The JDBC-drivers
implement synchronization for a reason most likely as well. The linked
docs don't forbid concurrent usage as well and don't explicitly advise
to only share sequentially.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail: [email protected]
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/1043666690.20200608185056%40am-soft.de.

Reply via email to