Android Question RDC and Begin-End Transaction

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings, all, and thank you in advance for your replies to this question.

With RDC for SQLite used with the parameters specified here, will the BeginTransaction, TransactionSuccessful, and EndTransaction work as they do with SQL (example below)?

B4X:
Typical usage:
SQL1.BeginTransaction
Try
    'block of statements like:
    For i = 1 to 1000
        SQL1.ExecNonQuery("INSERT INTO table1 VALUES(...)
    Next
    SQL1.TransactionSuccessful
Catch
    Log(LastException.Message) 'no changes will be made
End Try
SQL1.EndTransaction

Any and all replies are welcomed.

Sandy
 

tdocs2

Well-Known Member
Licensed User
Longtime User
Thank you, Luca.

ExecuteBatch (here)
If one of the commands fail all the batch commands will be cancelled (roll-backed).

I guess that with great care, ExecuteBatch could be used, but obviously it does not have the flexibility of BeginTransaction and TransactionSuccessful.

I have been looking at the app that I am developing to make it both a single user (use SQL) and multiuser (use RDC) app... It is more difficult than I thought. Many of my routines use Cursor which is not compatible with Type DBResult. I thought of bringing the results to a common denominator - a table (the RDC - courtesy of Luca) - but the performance overhead may be too much...

Best regards.

Sandy
 
Upvote 0
Top