Re: embeded tomcat and correct DataSource.

From: Rob Bygrave <robin(dot)bygrave(at)gmail(dot)com>
To: Dave Cramer <davecramer(at)postgres(dot)rocks>
Cc: Rob Sargent <robjsargent(at)gmail(dot)com>, "pgsql-jdbc(at)lists(dot)postgresql(dot)org" <pgsql-jdbc(at)lists(dot)postgresql(dot)org>
Subject: Re: embeded tomcat and correct DataSource.
Date: 2020-11-17 22:57:25
Message-ID: CAC=ts-HbFEfi6JH59Vd_r_Wqpu00P9zcoSd48vYJVtdVwxBTMA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

Sorry I'm probably mis-interpreting your question. Hopefully the comments
below are useful.

*> I should use the PGConnectionPoolDataSource if I wish to use Apache
connection pool mechanism.*

In short, I'm pretty sure the answer is no.

The longer answer is, PGPoolingDataSource is the DataSource implementation
provided in pgjdbc. PGPoolingDataSource is *deprecated* with the comment
below and noting that PGPoolingDataSource uses PGConnectionPoolDataSource
(as an implementation detail). We could think
of PGConnectionPoolDataSource as part of the DataSource implementation
provided with postgresql jdbc driver that is marked as deprecated (with the
suggestion that we migrate to any other third party DataSource
implementation).

* @deprecated Since 42.0.0, instead of this class you should use a
fully featured connection pool

* like HikariCP, vibur-dbcp, commons-dbcp, c3p0, etc.

Any third party javax.sql.DataSource implementation would be extremely
unlikely to use anything in the *org.postgresql.ds* package including
PGConnectionPoolDataSource.

Cheers, Rob.

On Wed, 18 Nov 2020 at 11:15, Dave Cramer <davecramer(at)postgres(dot)rocks> wrote:

> I haven't setup an embedded tomcat in a while. I'd like to know the answer
> as well.
>
> Any reason you aren't using something like quarkus ?
>
> Dave Cramer
> www.postgres.rocks
>
>
> On Mon, 16 Nov 2020 at 12:05, Rob Sargent <robjsargent(at)gmail(dot)com> wrote:
>
>> Asking for confirmation that, when using an embedded tomcat instance, I
>> should use the PGConnectionPoolDataSource if I wish to use Apache
>> connection pool mechanism.
>>
>>
>>
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2020-11-17 23:04:24 Re: embeded tomcat and correct DataSource.
Previous Message Dave Cramer 2020-11-17 22:15:22 Re: embeded tomcat and correct DataSource.