This isn't specific to jOOQ, but is a general rule regarding resources.
Whoever opens a resource must close the resource.
- A Connection is a resource, so you must close both in your first case
- A DataSource isn't a resource. It is used to create resources
(Connections). jOOQ creates these
Hello everyone,
If I understand correctly,
- if i pass a Connection to jooq to create a parsing connection, i need to
close both the parsing connection and its underlying connection
- if i pass a data source to jooq, i need to only close the parsing
connection, jooq handles the underlying
Hi Lukas,
Thanks again, You are alright.
Problem solved.
Le lun. 29 mars 2021 à 12:26, Lukas Eder a écrit :
> Hi Walid,
>
> - Whoever opens a JDBC Connection is responsible for closing it again
> - Your example is now passing the DataSource to jOOQ, in case of which
> jOOQ will open *and* close
Hi Walid,
- Whoever opens a JDBC Connection is responsible for closing it again
- Your example is now passing the DataSource to jOOQ, in case of which jOOQ
will open *and* close the connection for you
- However, you also close the underlying (wrapped) JDBC connection
explicitly in closeDbConn.
Why when I execute a query with jooq parsing connection I get
You can see in the attached files the code of the server and the connection
:
- jOOQ:3.15
org.jooq.pro
jooq
3.15.0
org.jooq.pro
reactivestreams
3.15.0
- Java:8
- Database :Postgresql
- OS:open suse
- JDBC Driver:4.2
--
You