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

Corrupt jdbc connection because of integrated connection pooler (c3p0) #3539

Closed
nupis-DanielS opened this issue Sep 1, 2023 · 9 comments
Closed
Labels
JDBC Device Registry The JDBC based Device Registry implementation

Comments

@nupis-DanielS
Copy link

Hi,

we use Eclipse Hono (jdbc device registry) in a Kubernetes environment with PostgreSql. When the postgres deployment restarts the now corrupt connection is still being used and is not closed by hono. That leads to an error for the first transaction after the restart.

Is there a possibility to use a new connection for every transaction or to disable the integrated c3p0 connection pool?

Hono error log

@sophokles73 sophokles73 added the JDBC Device Registry The JDBC based Device Registry implementation label Sep 1, 2023
@sophokles73
Copy link
Contributor

@mattkaem any thoughts?

@sophokles73
Copy link
Contributor

I believe that https://www.mchange.com/projects/c3p0/#configuring_connection_testing could provide some insights. I am not sure, though, if Hono currently uses connection checking but it looks like this could already be the solution to the problem.

@mattkaem
Copy link
Contributor

mattkaem commented Sep 4, 2023

I think currently we do not check the status of a connection before using it but, looking at the documentation of c3p0, it seems there is a way to do so (https://www.mchange.com/projects/c3p0/#configuring_connection_testing).
To my knowledge it is currently not possible to disable the connection pool or to have a new connection for every transaction.

@sophokles73
Copy link
Contributor

@nupis-DanielS would you like to give adding support for enabling connection checking a shot?

@mattkaem and I can support if necessary

@nupis-DanielS
Copy link
Author

Sure, i will give it a try ;-)

@harism
Copy link
Contributor

harism commented Oct 17, 2023

Switching to Quarkus Agroal datasource can also make a difference [#3562] and harden it connections are dropped from the pool.

@sophokles73
Copy link
Contributor

@nupis-DanielS with #3562 having been merged, is this still an issue?

@nupis-DanielS
Copy link
Author

Hi,

thank you for your development. Is there a possiblity to get a pre relase image of the version 2.5.0. We can only reproduce it in our cluster which uses the hono helm chart.

@nupis-DanielS
Copy link
Author

We updated the hono to version 2.5.0 and it looks good. No bad connections so far.

thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JDBC Device Registry The JDBC based Device Registry implementation
Projects
None yet
Development

No branches or pull requests

4 participants