-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
BugSomething isn't workingSomething isn't workingWaiting for replyWaiting for replyWaiting for reply
Description
Search before asking
- I had searched in the issues and found no similar issues.
What happened
启动时,日志报错:ERROR 25588 --- [ main] org.dinky.utils.SqliteUtil: Failed to recyle database: database in auto-commit mode
What you expected to happen
启动时,加载executeSql时,自动提交模式下调用了 commit()
修改对应的dinky-admin/src/main/java/org/dinky/utils/SqliteUtil.java
public void executeSql(String sql) throws SQLException {
// 修复异常: Failed to recyle database:database in auto-commit mode
// Statement pstmt = connection.createStatement();
// pstmt.executeUpdate(sql);
// connection.commit();
try (Statement stmt = connection.createStatement()) {
stmt.executeUpdate(sql);
if (!connection.getAutoCommit()) {
connection.commit(); // 在自动提交模式下不调用 commit()
}
}
}
How to reproduce
11
Anything else
No response
Version
1.2.3
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't workingWaiting for replyWaiting for replyWaiting for reply