Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot unwrap a PooledConnection as the class is package protected #201

Open
gpaglia opened this issue Nov 13, 2023 · 2 comments
Open

Cannot unwrap a PooledConnection as the class is package protected #201

gpaglia opened this issue Nov 13, 2023 · 2 comments

Comments

@gpaglia
Copy link

gpaglia commented Nov 13, 2023

Bug Report

PooledConnection should be public or some other ways of unwrapping a PooledConnection to get the underlying technology-specific connection should be provided.

For example, if PooledConnection wraps a PostgresqlConnection, one needs to unwrap the PooledConnection to get the PostgresqlConnection to execute postgres-specific operations like LISTEN and NOTIFY.

In the documentation I dind't find any hints on how to resolve.

Versions

  • Driver:: 1.0.1.RELEASE
  • Database: postgres 16
  • Java: 17
  • OS: Windows 10

Current Behavior

To work around this, I created a public utility class in the io.r2dbc.pool package with a public method tht calls the PooledConnection#unwrap method.

@mp911de
Copy link
Member

mp911de commented Nov 13, 2023

That shouldn't be necessary when calling Wrapped.unwrap(PostgresqlConnection.class). The unwrapping mechanism will unwrap the inner wrapped elements until it can return PostgresqlConnection.

@gpaglia
Copy link
Author

gpaglia commented Nov 14, 2023

Thanks, will try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants