sqlite database locked

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

sqlite database locked

Post by sandy771 » Sat 07 Aug 2010 08:13

I am having an odd problem with sqlite.

I am trying to update a few records in a database but am getting a database is locked error.

I am runing dbMonitor to see if I can determine where the error is. All calls prior to the error return status complete and are simple select * from table commands

I then see this

07/08/2010 08:07:30 0.000 Start: Complete
07/08/2010 08:07:30 0.000 Savepoint LOCK_ThumbTab Complete
07/08/2010 08:07:30 0.000 Rollback to savepoint LOCK_ThumbTab Error
07/08/2010 08:07:41 0.000 Commit: Complete
07/08/2010 08:07:41 0.889 SQL Execute: select * from rtable
Complete

any ideas what this is or what might be causing it?

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Mon 09 Aug 2010 13:36

Hello

Why do you think that this error is connected with record locking? Savepoints can contain any name and if savepoint contains "LOCK" in the name it doesn't mean that record locking is cause of error.

To help you resolve this issue we need the exact text of this error. Also we need information when you got this error: on calling the Edit or Post method, or on calling some script (in this case we need the text of the script).

sandy771
Posts: 194
Joined: Tue 22 May 2007 13:57

Post by sandy771 » Mon 09 Aug 2010 14:26

Away from my computer at the moment but the error occurred when writing to a table (post) which generated an exception - database isnlocked. It wa this that caused me to run the monitor.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Tue 10 Aug 2010 11:24

When you are able to reproduce this error, please provide me the exact text of the error message, and please provide me the part of your code where you modify this record. Also I need to know which component you are using: TUniQuery or TUniTable, the CachedUpdates and LockMode properties values, if you are modifying record in the transaction or not. This information will help me to reproduce this issue.

Lepsik
Posts: 12
Joined: Mon 27 Feb 2012 17:45
Contact:

Post by Lepsik » Fri 30 Mar 2012 16:17

This TUniTable link to TUniDataSource.

Code: Select all

   try
   WindProf.DisableControls;
   try
      WindProf.First;
          WindProf.Edit;
          WindProfData_1.Value := 0.1;
          WindProf.Post;             // 1. here exception happends
    finally
      WindProf.EnableControls;  // 2. after exception jump here
    end;
  except
    on e: exception do
    begin
      LogError( e.Message, funcName ); // 3. then here
    end;
    end;
in logs:

12:12:08|E| [TISCData.ISCDatabaseError]- Error code: 1. SQL logic error or missing database.

in monitor:

UPDATE WINDPROF
SET
Data_1 = ?
WHERE
PKey = ?

Data_1 = 0.1
Old_PKey = 1

---------------------------------------------------------------------

This is happend only with SQLite version. MSSQL version works fine.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 06 Apr 2012 09:22

Hello,

Please provide a script for creating a table and the versions of your SQLite, UniDAC and IDE in order that we could reproduce the problem.

Post Reply