Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-11

TSQLite3Connection setting itself to active in the designer

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bernd

I have made a strange observation: I have a form with a TSQLite3Connection and all the other components needed to drive a TDBGrid and everything is working fine. There is only one thing that initially caused me problems until I found out what it was: When the connection component is set to active at design time and I run my application then sometimes when doing a commit it says "database locked". The solution was to make sure it is set to active=False in the designer and only activate now after making sure that everything is set to inactive I still occasionally have the problem that suddenly I got my "database locked" problems again during debugging and after looking into the connection component something (not me) has set it to active again. I cannot reproduce what exactly is causing this. I am absolutely sure I did not change any of the TSQLQuery components or any other connected component to active the last time it happened (today) The only thing I can remember having done since yesterday (the last time I had to deactivate it) was adjusting some positions and anchors on the form. I tried to reproduce it but without success.

Its not really ultra dramatic, I can leave the DatabaseName property empty (which is what I have done now) this will prevent it completely from being it does NOT help setting it to
a different copy of the sqlite file, for some reasons this will not prevent the "database is locked" errors.

Bernd

Martin Schreiber
to Bernd
Bernd wrote 7 lines
Its not really ultra dramatic, I can leave the DatabaseName property empty (which is what I have done now) this will prevent it completely from being it does NOT help setting it to a different copy of the sqlite file, for some reasons this will not prevent the "database is locked" errors.

A hint: in order to prevent locks of the running project from the active design time instance set packetrecords of the datasets to -1. An open data cursor locks the Sqlite data file.

Martin