SQLite Auto Commit Mode Questions?

A few years back when we were coming from RealBasic to Xojo, one of the things that had to be changed was the way we were opening the database and beginning a transaction. Every time we opened we did the begin transaction and every time we committed we did the commitTransaction and same for rollback. This has been quite a problem to deal with because fundamentally how we write to the database sometimes does not play well with manually committing and then restarting a transaction.

However, today, thanks to my new best friend Gemini, I learned that there is an auto commit mode in sqlite. Gemini says that all I have to do to not use the manual mode is to not begin the transaction after opening the database. But is this supported by Xojo because there is the method on the database called .commitTransaction and .rollbackTransaction and .beginTransaction? Do I Have those built in methods or can I do it some other way. We just want to get rid of redoing a transaction every time we want to do something.

Thanks in advance.

My understanding is that unless you’ve started a transaction, the default behaviour of databases in Xojo is to commit each change as you make it. So yes, “auto commit” as you refer to it should be the default behaviour.

1 Like