Thank a lot Jay



________________________________
From: Jay A. Kreibich <[email protected]>
To: General Discussion of SQLite Database <[email protected]>
Sent: Wednesday, April 8, 2009 1:22:57 PM
Subject: Re: [sqlite] what is the default for the commit when the connection is 
opened.

On Wed, Apr 08, 2009 at 10:12:15PM +0200, Martin Engelschalk scratched on the 
wall:
> Hi,
> 
> sqlite does not know an "auto commit".

  Actually, that's what the default mode is called.  You're either in
  "autocommit" mode or you're in a transaction.  Starting a transaction
  turns off autocommit and committing/rolling back a transaction turns
  it back on.

  There is even an API call to ask what state things are in:

    int sqlite3_get_autocommit(sqlite3*);

  See: 
  http://www.sqlite.org/c3ref/get_autocommit.html
  http://www.sqlite.org/lockingv3.html#transaction_control

> If you do not call "begin transaction", then every insert/update/delete 
> statement is wrapped in its own transaction. This is like "auto commit"

  In the context of SQLite this *is* autocommit.  Each statement is
  wrapped in an automatic transaction.

> If you do call "begin transaction", you start a transaction which you 
> have to finish with "commit" or "rollback".

> This does not depend on how you open the database.

  No, but you always start out in autocommit mode, since you're not
  inside an explicit transaction.

  -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
a protractor."  "I'll go home and see if I can scrounge up a ruler
and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



      
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to