On 26 Jun 2012, at 4:11pm, "Black, Michael (IS)" <michael.bla...@ngc.com> wrote:

> So...transaction is started at sqlite3_step and stays open until 
> sqlite3_reset or sqlite3_finalize, right?
> 
> sqlite3_close would do what if you didn't finalize?  Just a memory leak or 
> worse?  Or would sqlite3_close return an error if there's an open transaction?

<http://www.sqlite.org/c3ref/close.html>

"Applications must finalize all prepared statements and close all BLOB handles 
associated with the sqlite3 object prior to attempting to close the object. If 
sqlite3_close() is called on a database connection that still has outstanding 
prepared statements or BLOB handles, then it returns SQLITE_BUSY."


on the other hand ...

"If sqlite3_close() is invoked while a transaction is open, the transaction is 
automatically rolled back."

It is not an error to close the file while you're in the middle of a 
transaction.  It just means you didn't commit the transaction.

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

Reply via email to