"Jiri Hajek" <[EMAIL PROTECTED]> writes:

> 1. Occasionally after running Sqlite3_step() I get SQLITE_CANTOPEN ('Unable
> to open the database file') error. I found out that it can be fixed by
> running the query again, i.e. again calling Sqlite3_Prepare(). So this isn't
> a big issue, but still I wonder why this error message is returned?
> Shouldn't SQLITE_BUSY or SQLITE_LOCKED be returned instead?
>
> 2. More serious issue is that after I enable transaction usage (not used in
> 1.) sometimes (again, it's random) after calling 'BEGIN TRANSACTION' I get
> an error SQLITE_ERROR ('cannot start a transaction within a transaction').
> Problem is that I definitely am not already in a transaction. The only
> reason for this seems to be that there's >1 thread running, with only 1
> thread running there's no problem.

Do you have a separate database handle (provided by a unique call to
sqlite3_open()) for each and every thread?  If not, the above sort of error
can occur.  If you ensure that every thread opens the database itself and no
thread ever modifies the schema, you should not see either of those problems.

Cheers,

Derrell

Reply via email to