programmatic wipe of connection pool?

21 views
Skip to first unread message

William Burke

unread,
Mar 3, 2023, 9:03:56 AM3/3/23
to Quarkus Development mailing list
Is there a way to programmatically wipe clean the connection pool used by Panche and/or Hibernate at runtime?  Users are having issues with stale connections when using Lambda SnapStart.

--
Bill Burke
Red Hat

Sanne Grinovero

unread,
Mar 3, 2023, 9:13:02 AM3/3/23
to bbu...@redhat.com, Luis Barreiro, Quarkus Development mailing list
On Fri, 3 Mar 2023 at 14:03, William Burke <bbu...@redhat.com> wrote:
Is there a way to programmatically wipe clean the connection pool used by Panche and/or Hibernate at runtime?  Users are having issues with stale connections when using Lambda SnapStart.

Hi Bill,
this has indeed been requested before, but I don't remember if it was implemented; Luis would know.   If not we really should look into it, or ideally improve without the need for end user's code.

Sanne

 

--
Bill Burke
Red Hat

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/CAL%3DE%3DjTcY40DEzsgVvvAxdq9UwAuXnQt6jENZBOHZaUJA3nSdg%40mail.gmail.com.

Georgios Andrianakis

unread,
Mar 3, 2023, 9:14:03 AM3/3/23
to bbu...@redhat.com, Quarkus Development mailing list
Wouldn't it make more sense to have AgroalDataSource implement the Crac interfaces that control checkpoint and restore?

--

David Lloyd

unread,
Mar 3, 2023, 9:18:34 AM3/3/23
to gand...@redhat.com, bbu...@redhat.com, Quarkus Development mailing list
Better still would be to have a Quarkus API for this so that we don't have a dependency on these APIs.



--
- DML • he/him

Georgios Andrianakis

unread,
Mar 3, 2023, 9:20:24 AM3/3/23
to David Lloyd, bbu...@redhat.com, Quarkus Development mailing list
On Fri, Mar 3, 2023 at 4:18 PM David Lloyd <david...@redhat.com> wrote:
Better still would be to have a Quarkus API for this so that we don't have a dependency on these APIs.

We already have a dependency on io.github.crac:org-crac, but we can certainly remove it and come up with something of our own - it was just the easiest way to get some Crac support almost for free

William Burke

unread,
Mar 3, 2023, 9:20:38 AM3/3/23
to Georgios Andrianakis, Quarkus Development mailing list
Yes Georgios, was going to suggest that the user implement an observer for StartEvent and register a Crac callback to flush() the connection pool.  Looks like they can just inject the AgroalDataSource and do this.

We should automatically do this in the Agroal extension, IMO.  I'll do a separate PR for this.

Georgios Andrianakis

unread,
Mar 3, 2023, 9:21:31 AM3/3/23
to William Burke, Quarkus Development mailing list
On Fri, Mar 3, 2023 at 4:20 PM William Burke <bbu...@redhat.com> wrote:
Yes Georgios, was going to suggest that the user implement an observer for StartEvent and register a Crac callback to flush() the connection pool.  Looks like they can just inject the AgroalDataSource and do this.

We should automatically do this in the Agroal extension, IMO.  I'll do a separate PR for this.

Excellent👌 

Sanne Grinovero

unread,
Mar 3, 2023, 10:05:16 AM3/3/23
to bbu...@redhat.com, Georgios Andrianakis, Quarkus Development mailing list
On Fri, 3 Mar 2023 at 14:20, William Burke <bbu...@redhat.com> wrote:
Yes Georgios, was going to suggest that the user implement an observer for StartEvent and register a Crac callback to flush() the connection pool.  Looks like they can just inject the AgroalDataSource and do this.

We should automatically do this in the Agroal extension, IMO.  I'll do a separate PR for this.

+1 Awesome
Reply all
Reply to author
Forward
0 new messages