Re: [sqlite] what is the default for the commit when the connection is opened.

2009-04-09 Thread Joanne Pham
Thank a lot Jay





From: Jay A. Kreibich 
To: General Discussion of SQLite Database 
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
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



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


Re: [sqlite] what is the default for the commit when the connection is opened.

2009-04-08 Thread Jay A. Kreibich
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
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] what is the default for the commit when the connection is opened.

2009-04-08 Thread Martin Engelschalk
Hi,

sqlite does not know an "auto commit".
If you do not call "begin transaction", then every insert/update/delete 
statement is wrapped in its own transaction. This is like "auto commit"
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.

Martin

Joanne Pham wrote:
> Hi All,
> When we use the sqlite3_open_v2 to open the database is this defautl to "Auto 
> commit" ?
> Thanks,
> JP
>
>
>   
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] what is the default for the commit when the connection is opened.

2009-04-08 Thread Joanne Pham
Hi All,
When we use the sqlite3_open_v2 to open the database is this defautl to "Auto 
commit" ?
Thanks,
JP


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