final SQLiteConfig config = new SQLiteConfig();
config.setReadOnly(false);
config.setLockingMode(LockingMode.NORMAL);
connection = DriverManager.getConnection(url, config.toProperties());
If your using your SQLite db file over a NFS shared folder, check this point of the SQLite faq, and review your mounting configuration options to make sure your avoiding locks, as described here:
Aug 8 10:33:38 server01 kernel: lockd: cannot monitor 172.22.84.87
还有这个:
Aug 8 10:33:38 server01 rpc。statd[7430]: Failed to insert: writing /var/lib/nfs/statd/sm/other.server.name.com: No space left on device .日志含义
Aug 8 10:33:38 server01 rpc。statd[7430]: STAT_FAIL to server01 for SM_MON of 172.22.84.87
%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\Default\Web Data
or
%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\Default\Chrome Web Data
Mac
~/Library/Application Support/Google/Chrome/Default/Web Data
在我编写的一个c# . net 4.6.1应用程序中,当它试图写入数据时,我也收到了sqlite锁,但在我的开发机器上的Visual Studio中运行该应用程序时却没有。相反,只有在远程Windows 10机器上安装并运行该应用程序时,才会出现这种情况。
最初我认为是文件系统权限,但事实证明是我使用Nuget在项目中安装的system . data . sqlite包驱动程序(v1.0.109.2)导致了这个问题。我删除了NuGet包,并在项目中手动引用了旧版本的驱动程序,一旦应用程序重新安装在远程机器上,锁定问题就神奇地消失了。只能认为是最新的驱动程序或Nuget包有bug。