• Welcome, Guest. Please login.
 
August 19, 2019, 07:23:22 am

News:

Welcome to the SQLitening support forums!


1.3 - Bn modchar need explicit END TRANSACTION?

Started by Bern Ertl, January 12, 2010, 05:45:07 pm

Previous topic - Next topic

Bern Ertl

I see in that version 1.3 introduced a new modchar:
Quote10. Added the following ModChars to slSel, slSelAry, and to the SelStatemnt of
    slSetRelNameLocks:
      Bn = Do a Begin Transaction before doing the Sel command. The type
           of Begin is controlled by the value of n as follows:
              0 = Deferred. This is the default if n is omitted.
              1 = Immediate.
              2 = Exclusive.
           This allows for database locking and selecting in one trip to the server.


It's not clear though if I SQLitening is ending the explicit transaction or if I need to add an slExe "COMMIT;" to free up the lock.

Fred Meier

Nice to have you back, Bern.

SQLitening does not end the transaction, you must do that after you have
processed the selected rows.  This was added just to save a trip to the
server.  The following locks the database while you are looking at the rows.
slSel "Select * from T1", 0, "B"
do while slGetRow
   'look at row
loop
slExe "End"


Bern Ertl

Excellent.  No issues then with using it to establish an exclusive lock and holding it through a couple of different selections/insertions/etc. before releasing then.  :)