RE: [sqlite] Does sqlite really support transaction?

2005-05-13 Thread John Buck
>Jay Sprenkle wrote: >The transaction doesn't seem any different than a snapshot of the >database that you can restore to. I just wondered why there were two >methods of doing the same thing. Only in a single user/single thread case are they the same thing. With Sqlite that might always be

Re: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Jay Sprenkle
> A transactions is exactly like the original poster stated it. > > Assuming all Update, Select, Insert Commands are Atomic. A transaction > allows the user to group a bunch of commands together and state they should > be considered atomic, whereas if there is "a failure", then none of them are

RE: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread John Buck
lite.org Subject: Re: [sqlite] Does sqlite really support transaction? > > > MySql works like you described.. Frankly im surprised Postgres doesn't . > > Id imagine there must be a "continue trnasaction" command or something. > > You can define a 'savepoint' insid

Re: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Jay Sprenkle
> > > MySql works like you described.. Frankly im surprised Postgres doesn't . > > Id imagine there must be a "continue trnasaction" command or something. > > You can define a 'savepoint' inside a transaction. If something goes > wrong you roll back to the savepoint and continue from there. >

Re: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Gé Weijers
12, 2005 12:25 PM > To: sqlite-users@sqlite.org > Subject: RE: [sqlite] Does sqlite really support transaction? > > > >>> This isn't an SQLite thing either... All databases work >> >>this way, as >> >>>far as I'm aware. >>> >>>

RE: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Michael Evenson
commands with the command isqlite program, the commands can just keep executing. > -Original Message- > From: John Buck [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 12, 2005 12:33 PM > To: sqlite-users@sqlite.org > Subject: RE: [sqlite] Does sqlite really supp

RE: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Brandon, Nicholas
nt: 12 May 2005 17:12 To: sqlite-users@sqlite.org Subject: RE: [sqlite] Does sqlite really support transaction? *** WARNING *** This mail has originated outside your organization, either from an external partner or the Global Internet. Keep this in mind if you answer this me

RE: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Thomas Briggs
> > This isn't an SQLite thing either... All databases work > this way, as > >far as I'm aware. > > > > > Postgres refuses to process any further sql statements in a > transaction > after an error occurs with > one of the sql statements. Heh. I should have said that "all databases

RE: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread John Buck
, May 12, 2005 11:26 AM To: sqlite-users@sqlite.org; Jay Sprenkle Subject: Re: [sqlite] Does sqlite really support transaction? Here is the problem. My external program builds sql script and places into file my_script.sql Then I execute statement "sqlite3 my_db < my_script.sql" as a sys

Re: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread John LeSueur
Thomas Briggs wrote: A transaction is a way to make a group of things that happens atomic, but an SQL statement that generates an error doesn't really make anything happen, so it has no impact on the transaction itself or any of the other actions within it. That kinda the whole point, in a way

RE: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Thomas Briggs
Jay Sprenkle > Subject: Re: [sqlite] Does sqlite really support transaction? > > Here is the problem. My external program builds sql > script and places into file my_script.sql > Then I execute statement "sqlite3 my_db < > my_script.sql" as a system call fro

Re: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Vladimir Zelinski
Here is the problem. My external program builds sql script and places into file my_script.sql Then I execute statement "sqlite3 my_db < my_script.sql" as a system call from my external program. I can check result of execution this statement and it always returns 0 (success) regardless of actual

RE: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread John Buck
Any return other then 0 from the API function you use to exec your SQL statement is a fail. -- JB -Original Message- From: Vladimir Zelinski [mailto:[EMAIL PROTECTED] Sent: Thursday, May 12, 2005 10:31 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Does sqlite really support

Re: [sqlite] Does sqlite really support transaction?

2005-05-12 Thread Gé Weijers
Vladimir, When you execute individual statements and sqlite3_step or sqlite3_exec returns an error code you should execute a 'ROLLBACK' in stead of a 'COMMIT'. So the logic is: exec "BEGIN" perform a bunch of statements if(all statements successful) exec "COMMIT" else exec "ROLLBACK"