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

JdbcConnection.CloseAsync() issue #34

Open
TinaRadenkovic opened this issue Dec 25, 2023 · 1 comment
Open

JdbcConnection.CloseAsync() issue #34

TinaRadenkovic opened this issue Dec 25, 2023 · 1 comment

Comments

@TinaRadenkovic
Copy link

During the opening of the connection using JdbcConnection.OpenAsync() method with correct DriverPath and DriverClass but an incorrect JdbcUrl, the driver starts, and the connection status becomes Broken. However, when attempting to close this connection, the driver remains active and requires manual shutdown.
The problem lies in the JdbcConnection.CloseAsync() method, which only sets the connection status to Closed. The JdbcBridgePool.Release(Bridge.Key) is not executed due to a condition in the if statement where ConnectionId is null.
Should this be fixed in future updates?

@smilinger
Copy link

Also, the ConnectionId should be set to null after the connection is closed, otherwise if the subsequent connection fails, it will try to close the broken connection, which will throw an exception that says:

Cannot invoke "java.sql.Connection.close()" because "connection" is null

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

No branches or pull requests

2 participants