-
Notifications
You must be signed in to change notification settings - Fork 594
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
Possible race condition in SQLitePooledConnection #821
Comments
Would you be able to provide an example project or unit test that would highlight the problem maybe ? |
Sure, I have created the following project: https://github.com/nicolatimeus/sqlite-test/blob/main/src/main/java/com/github/nicolatimeus/App.java On my machine execution stops after a few iterations with exceptions like the following:
|
Thanks, i have the same error on my machine, and managed to set your sample as a unit test. I'm not sure about the fix though.
This doesn't fix the issue. |
Thank you for testing this out. I'm experimenting with change [1] that seems to fix the issue for me, other than reordering the statements in the close method I have added an extra check to avoid running the close logic twice during |
@gotson any news on that ? |
I am not working on this, PRs are welcome. |
Hi all,
I've noticed that at
sqlite-jdbc/src/main/java/org/sqlite/javax/SQLitePooledConnection.java
Line 106 in 3904e83
the
ConnectionEventListener.connectionClosed()
method is called and then the subsequent lines may perform modifications on the released connection:sqlite-jdbc/src/main/java/org/sqlite/javax/SQLitePooledConnection.java
Line 110 in 3904e83
sqlite-jdbc/src/main/java/org/sqlite/javax/SQLitePooledConnection.java
Line 112 in 3904e83
Should these modifications be moved before the invocation of
ConnectionEventListener.connectionClosed()
? Otherwise the client code may start reusing the released connection concurrently while they are being performed.The text was updated successfully, but these errors were encountered: