Database Locked error

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bzwirs
Posts: 40
Joined: Sat 10 Jul 2010 06:47

Database Locked error

Post by bzwirs » Mon 29 Apr 2019 08:26

Hi,

Using latest version of LiteDAC and Delphi 10.3.1

I had a multi device project working with SQLite3 database using LiteDAC without any problems accessing/reading/writing to the database. My problem was that I had designed the project with multiple forms like a VCL project (I am not yet proficient with multi platform development). Needless to say that I had many problems running this on iOS and Android - except for the database access. So, I had to rewrite the project using a single form with a tab sheet (up to 8 tabs) as this is what my research suggested I should do. Most of this turned out to be a cut and paste to the new project. Although I cut and past the components and code to the new project I now get a 'Database locked' error,.

The error occurs in a procedure where I populate 4 tables in the database using 4 LiteQry components. Each is set to 'cached update = true'. I populate each dataset and then check for updayespending before applyupdates. When applyupdates is used on the first of the datasets I get the Database locked error. On further research I have changed the database journal_mode to WAL and now if the records are saved but I then get the database locked error when attempting any further database actions.

Can someone please help me and explain why this should be happening. My old project which works fine on Windows but not on other devices doesn't have any of these database problems yet my new project is a copy of the old.

Any assistance would be appreciated.

Bill Zwirs

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Database Locked error

Post by MaximG » Fri 10 May 2019 13:11

please compose and send us a project, execution of which causes the issue. For your convenience, please use the e-support form https://www.devart.com/company/contactform.html

Post Reply