-
Notifications
You must be signed in to change notification settings - Fork 620
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
java sqlite jdbc always database is locked #1120
Comments
did you check https://www.sqlite.org/rescode.html#busy_snapshot ? |
thanks you i solve this problem,but happened a new problem
i use HikariDataSource dataSource = new HikariDataSource();
dataSource.setJdbcUrl(url);
dataSource.setMaximumPoolSize(1);
dataSource.setMinimumIdle(1);
dataSource.setConnectionTimeout(50000); |
The "new" problem looks like a usage problem or issue within MyBatis' configuration. By default all connections returned from a HikariDataSource have autoCommit be set to true (Doc). That is causing the shown stacktrace. Try and set the default value for autoCommit to false on the dataSource, or if you are passing connections around manually, you can just set the autoCommit to true on a certain connection. |
Describe the bug
use HikariDataSource manage sqlite jdbc connection.
but still happen database is locked.
To Reproduce
product enviroment is always happen. but test enviroment is less.
Expected behavior
A clear and concise description of what you expected to happen.
Logs
Environment (please complete the following information):
windos 7
jdk 1.8
Additional context
When my Java program performs database operations, I always add a global synchronized lock, but only for delete, insert, and update operations.
for example:
The text was updated successfully, but these errors were encountered: