Another? Database is Locked

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
heerdinm
Posts: 14
Joined: Fri 14 Dec 2012 11:35

Another? Database is Locked

Post by heerdinm » Fri 10 May 2013 07:41

Hello,

i have the following piece of code:

Code: Select all

  try
    qry := dmAeres.qryUsers;
    if not qry.Active then
      qry.Active := True;
    if not qry.Locate(UA_USERNAME, Username, [loCaseInsensitive]) then begin
      qry.Append;
      qry.FieldByName(UA_USERNAME).AsString := UserName;
      qry.Post;
    end;
  except
    on E: Exception do begin
      SKAMessageOk(E.Message);
    end;
  end;
I get information from LDAP and extra information i need for the user i write in an SQLite database. When another user uses the program with the same database, i sometimes get the message "Database is Locked" when i try to do something. I think it has to do with the above code, but i can not test it, since i have no rights to install Delphi om the computer i am testing on. I can only program on one computer and run it on another.

The code above is what i am used to doing with MSAccess, i found some differences with SQLite, but i do not know what to do in the above.
Do i need to put an Unlock or a Commit after the Post? or should the above be enough.

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

Re: Another? Database is Locked

Post by AlexP » Fri 10 May 2013 09:28

hello,

For parallel access to a DB from different applications, extended options were added to delimit simultaneous access to a DB: BusyTimeout, EnableSharedCache, ReadUncommitted. You can find more detailed information on these options in the UniDAC help.

Post Reply