On 9/21/15, Shuhrat Rahimov <sandrorkmv at gmail.com> wrote:
> Hi all,
> I have ported SQLite to an embedded ARM Cortex M4 based processor. a bare
> metal firmware is using SQLite, no OS. It seems to work but occasionaly
> bindText function fails. So, I am doing 20 inserts as a one transaction,
> but occasionally after 400-460 inserts bindText returns Error 21. I have
> seen that it is occuring in vdbeUnbind function, log is: "bind on a busy
> prepared statement". Could you help me to find out what the problem can be?

The prepared statement is still in use when you try to call
sqlite3_bind_text().  You can see this by adding "assert(
sqlite3_stmt_busy(pStmt) );" right before you call
sqlite3_bind_text(pStmt,...).  This is an application-level error, not
a problem with SQLite or your port.

You need to invoke sqlite3_reset() on a prepared statement that has
been previously used before you run sqlite3_bind_text() on that
prepared statement.

-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to