Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 11.5 ('Weeds')
Instant purchase and download via GumRoad!

COLUMN

SQLiteDatabase

The differences between SQLiteDatabase and REALSQLDatabase

Issue: 11.5 (September/October 2013)
Author: Seth Verrinder
Author Bio: Seth is a consultant who uses Xojo and Real Studio every day in his job at BKeeney Software, Inc.
Article Description: No description available.
Article Length (in bytes): 6,605
Starting Page Number: 74
Article Number: 11511
Related Link(s): None

Excerpt of article text...

Xojo has deprecated REALSQLDatabase although it still works for now. If you use it, you should probably begin thinking about moving to the new SQLiteDatabase class. This article explores some of the differences between the two classes. Fortunately there aren’t too many differences and there are some new features in SQLiteDatabase that might make your life easier.

AutoCommit

The main difference is that the new class doesn’t have the AutoCommit property. AutoCommit in the old class defaulted to false and this meant that when you issued any kind of statement that changed the database it didn’t get committed immediately. At some point in your program you had to call the Commit method, only then would your changes up to that point actually be saved in the database file.

In older versions of REALbasic, the database would automatically do a commit when the application shut down. Unfortunately, if your application crashed, this commit couldn’t happen and, as I understand it, there were cases where the commit wasn’t reliable even when the application didn’t crash. For this reason, in recent versions of Real Studio and Xojo (I don’t know the exact version where this changed), there is no automatic commit when the program quits. If you make changes to the database and don’t call commit yourself, all of your changes will be lost.

Another problem with having AutoCommit off is that internally this meant there was a transaction in progress all the time. This only works if one program and one database object within that program are accessing the database at a time.

How Transactions Work

...End of Excerpt. Please purchase the magazine to read the full article.