Paul Harris wrote:
> Many years ago, Igor mentioned that you should always reset/finalize any
> prepared statements before calling COMMIT.
>
> I am wondering, is this still true?

Yes.

There was a change in 3.7.11, but not with COMMIT itself:
| * Pending statements no longer block ROLLBACK. Instead, the pending
|   statement will return SQLITE_ABORT upon next access after the
|   ROLLBACK.

> Do I have to reset before I commit?  And where is the requirement written
> in the sqlite documentation?

<http://www.sqlite.org/lang_transaction.html> says:
| An implicit transaction (a transaction that is started automatically,
| not a transaction started by BEGIN) is committed automatically when
| the last active statement finishes. A statement finishes when its
| prepared statement is reset or finalized.
|
| The explicit COMMIT command runs immediately, even if there are
| pending SELECT statements. However, if there are pending write
| operations, the COMMIT command will fail with an error code
| SQLITE_BUSY.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to