Accessing Hikari connection from ratpack.server.Service with pgjdbc-ng
I'm having trouble getting a Hikari connection from a Service implementation.
Basically the situation is the following.
I got Hikari correctly configured to use pgjdbc-ng (https://github.com/impossibl/pgjdbc-ng). To use this driver I needed to exlude netty dep from pgjdbc-ng but that shouldn't be the problem.
Then I implemented Service, in the onStart method I obtain a connection and fire a "LISTEN my_channel" on PostgreSQL to get notified by a custom trigger, the whole fit in the PGNotificationListener from pgjdbc-ng.
Now every time a particular query is issued in the DB, my trigger fire and I got notified on my_channel. Cool a simple event bus in the DB.
The problem start to happen when in the NotificationListener implementation I try to access the DB (from the same Hikari DataSource as above).
The connection fall in timeout and I cannot get to the DB.
I suspect something (a reference) is lost in the path between ratpack thread handling and pgjdbc-ng connection notification.
Re: Accessing Hikari connection from ratpack.server.Service with pgjdbc-ng
Nope, I didn't.
Can you give me a practical idea on what do you mean with "starting a new ratpack execution", I understand it as a completely new ratpack server within a thread in another netty eventloop. Is that what you mean ?