Markus Kolb <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I have some questions to autocommit mode of SQLite 3.3.4 and its
> transactions.
> 
> Did I understand it right that new or changed row data is only written
> to disk when the db connection is closed with sqlite3_close?

No.  Data is guaranteed to be written to disk when you COMMIT,
and a COMMIT happens automatically after every statement in
autocommit mode.

SQLite transactions are (among other things) Durable.  That means
that all the data is safely on the disk surface before COMMIT
returns (autocommit or explicit commit).  You can take an power
failure or OS crash at any point after a COMMIT and the data will
survive (assuming your disk drive doesn't get wasted - nothing
really we can do about that.)

Where did you get the idea that data is only written to disk
on close?  Is there some point in the documentation that needs
to be clarified?

> 
> Did I understand it right that after a transaction commit, autocommit is
> enabled again

Yes.

> and the data from the transaction is written to disk not
> before the db connection is closed like in autocommit mode with
> sqlite3_close?

No.  See above.

> 
> Is there a way to force a diskwrite without closing the db connection?
> 

Yes.  See above.

--
D. Richard Hipp   <[EMAIL PROTECTED]>

Reply via email to