Database locked when trying to commitretaining [SOLVED] lazarus / 16-Databases ---------------------------------------------------------------------- JanRoza · 2014-12-12 10:54 Hi, I have a nasty situation with SQLDB and SQLite I cannot put my finger on. My application has a dbconnection, a transaction and a number of queries. When I close the main form of my application I set all queries to inactive (active := false) and after that I do a commitretaining (transaction.commitretaining) but my application always gives an error "database locked" the moment the commitretaining is triggered. I'm doing something basically wrong but what am I doing wrong? What's the correct sequence of action to get a working commitretaining? (using Lazarus 1.2.8/FPC 2.6.4 on Windows 8.1) ---------------------------------------------------------------------- LacaK · 2014-12-12 11:20 Did you not have opened database in Lazarus IDE at same time ? (Connected=True in IDE) If you get "databse locked" error, then any other process has open database. ---------------------------------------------------------------------- JanRoza · 2014-12-12 11:44 Found it...... I had used tsqlite3dataset in the program before I switched over to sqldb completely. I still had Sqlite3DS in the uses clauses in the project file and although I didn't use it in the program anymore it seems this one caused the lock. After deleting it from the uses clause everything went as it should. So simple that I failed to see it at first, shame on me.