https://kotlinlang.org logo
#jasync-sql
Title
# jasync-sql
d

dave08

01/17/2023, 12:49 PM
Is there a way to re-use an existing Jasync connection with an r2dbc client? Something like: https://kotlinlang.slack.com/archives/C03JF82SDHA/p1673956367718769?thread_ts=1673954851.885979&cid=C03JF82SDHA
o

oshai

01/17/2023, 4:25 PM
R2dbc has it's own pool concept. You can try to use that
d

dave08

01/17/2023, 4:28 PM
How do I use the regular Jasync api for all the old code, and re-use that same connection for r2dbc? I need to gradually migrate to komapper... so I don't think just using r2dbc's pooling would solve the problem?
o

oshai

01/17/2023, 4:30 PM
Doesn't sounds like something simple to implement 🤔
I wonder if it worth the hassle for migration period
Maybe by creating a pool facade that implements the r2dbc api and use jasync
If you do that publish it as jasync module
Contribute to open source 🙂
d

dave08

01/17/2023, 4:35 PM
You mean turning the Jasync connection into one supported by R2dbc with the above
ConnectionFactory
is not currently possible?
Isn't that what the current r2dbc support does?
o

oshai

01/17/2023, 4:37 PM
But hiw do you return the connection to the pool
d

dave08

01/17/2023, 4:38 PM
Maybe by not creating a pool with jasync, and letting r2dbc do that with it's pool implementation?
How do you do that in the current r2dbc driver?
o

oshai

01/17/2023, 4:43 PM
The jasync r2dbc is without pooling. R2dbc pool is separate and use it. If you can get the r2dbc pool instance and get the connection from it you can work on it maybe.
IDK how straight forward that is
Never tried
d

dave08

01/17/2023, 4:58 PM
I guess it would be impractical to use the old code w/o a pool anyways... thanks for the suggestions though!
o

oshai

01/17/2023, 5:02 PM
If you end up with a solution let me know. I don't know if the price of two pools during transition is high price to pay
16 Views