I am trying to wrap my head around the way the use transactions for sqlite from within a lazarus program.
I should explain that my background is DB2 and in that environment transactions are implicit. A transaction starts when a statement that updates the database is issued and ends when a COMMIT or ROLLBACK command is issued. In sqlite you need to issue an explicit START TRANSACTION command.
That's okay, but in Lazarus a transaction is an object which gets placed in a data module (or created dynamically) which seems odd to me. To make things more confusing the StartTransaction command be be issued on either the database connection or on the transaction object. Is there a difference between my_database.Starttransaction and my_transaction.starttransaction ?
I have a read only SQL query. Trying to run it produces the message "Transaction not active" which I don't follow. If I'm not updating the database why is a transaction required?
If I add a transaction to the Data Module and try and start it before opening the sql I get "Transaction already active"
I've scanned all the tutorials I can find but I can't find any that explain how this works. Can anyone point me to a good explanation? Thanks in advance.
Graham