I have created a database, this table has multiple tables. The tables are
accessed through APIs.
I have a particular problem with one of my table. I have written a few
APIs for it. One API is used to Set (add or update) a record to it, one is
used to retrieve the actual records in the table, one is used to remove a
particular entry, one is used to clean the table from any entry, etc.
I am facing the following frustrating scenario:
1. I can Add/Update as many records as I want with no problem.
2. I can retrieve the records that I have created with no problem. In
order to use the Retrieve API I first call another API (GetNum) which
tells me how many records there are to be retrieved.
3. Once I have used the retrieved API I can no longer Add/Update any
entry, I get the "database table is locked" error.
4. I can still retrieve my records, but it remains locked.
This is how I add/update records:
sqlite3_exec("insert or replace into ......");
This is how I do the get num:
sqlite3_prepare("select count(*) from ...");
sqlite3_step( ... );
sqlite3_column_int(...);
sqlite3_finalize( ... );
This is how I do the retrieval:
sqlite3_prepare("select * from ...");
sqlite3_step(...);
sqlite3_column_text(...);
sqlite3_finalize(...);
Anyone has an idea of what may be wrong ? Oh yeah, I am running of my own
port using uCos and a memory database.
Mario Hebert
Legerity