NutzCN Logo
问答 Springboot整合nutz使用sqlite数据库保存报错, [SQLITE_BUSY] The database file is locked (database is locked)
发布于 10天前 作者 tanlj 152 次浏览 复制 上一个帖子 下一个帖子
标签:

有没有人遇到过这种情况?
配置信息如下:

driver-class-name: org.sqlite.JDBC
url: jdbc:sqlite:/sqlite.db?busy_timeout=10000
username:
password:
type: org.apache.commons.dbcp2.BasicDataSource
params:
  max-total: 10
  initialSize: 5
  max-wait-millis: 60000
  max-idle: 5
  min-idle: 2
  time-between-eviction-runs-millis: 30000
  numTestsPerEvictionRun: 3
  remove-abandoned-on-borrow: true
  remove-abandoned-timeout: 180
  test-while-idle: true
  test-on-borrow: true
  test-on-return: true
  validation-query: select 5
  validation-query-timeout: 1

异常信息如下:

2021-03-31  14:24:46.284 [Thread-7] DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SQLException
org.sqlite.SQLiteException: [SQLITE_BUSY]  The database file is locked (database is locked)
	at org.sqlite.core.DB.newSQLException(DB.java:1010)
	at org.sqlite.core.DB.newSQLException(DB.java:1022)
	at org.sqlite.core.DB.execute(DB.java:861)
	at org.sqlite.jdbc3.JDBC3PreparedStatement.execute(JDBC3PreparedStatement.java:54)
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:198)
	at org.apache.commons.dbcp2.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:198)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runPreparedStatement(NutDaoExecutor.java:311)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:96)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:65)
	at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:63)
	at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:138)
	at org.nutz.integration.spring.SpringDaoRunner._run(SpringDaoRunner.java:18)
	at org.nutz.dao.impl.sql.run.NutDaoRunner$1.run(NutDaoRunner.java:79)
	at org.nutz.trans.Trans.exec(Trans.java:174)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:77)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:242)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:254)
	at org.nutz.dao.impl.EntityOperator.exec(EntityOperator.java:58)
	at org.nutz.dao.impl.NutDao.insert(NutDao.java:151)
2 回复

百度或Google,明显不是nutz的问题。

@Wizzercn 确实不是nutz的问题,是实施人员把sqlite文件挂到了网盘,操作系统内核2.1协议导致!

添加回复
请先登陆
回到顶部