Controlling SQLite transactions

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Controlling SQLite transactions

Post by phaworth » Thu Oct 15, 2009 12:23 am

I need the ability to define sequences of SQLite statements as transactions. The dictionary shows me command to issue COMMIT and ROLLBACK commands but I don;t see anything that will issue a BEGIN. Am I missing something? Do I have to use revExecuteSQL to issue a BEGIN?

In addition, the command/function that issues a ROLLBACK doesn't provide a way to include the SAVEPOINT parameter of the ROLLBACK command. Does this mean I have to use revExecuteSQL again?

Thanks,
Pete

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Thu Oct 15, 2009 1:51 am

Skip the RevDB calls and just execute the BEGIN, COMMIT and ROLLBACK commands yourself with revExecuteSQL.

With Rev 4.0 the SQLite driver has been updated to 3.6.17 which has support for savepoints. So if you have that driver you can use savepoints with revExecuteSQL.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Thu Oct 15, 2009 1:57 am

Thanks Trevor, had pretty much come to that conclusion.

I guess I'm not sure about 4.0. IS it publicly released or still in beta?

Pete

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Thu Oct 15, 2009 1:59 am

Still in Beta. You could *probably* just snatch the dbsqlite.dll/.bundle that comes with 4.0 and use it in a 3.5 installation though if you need savepoints.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

Post Reply