Book Image

Learning SQLite for iOS

By : Gene Da Rocha
Book Image

Learning SQLite for iOS

By: Gene Da Rocha

Overview of this book

The ability to use SQLite with iOS provides a great opportunity to build amazing apps. Apple's iOS SDK provides native support for SQLite databases. This combination offers the potential to create powerful, data-persistent applications. This book starts with the architecture of SQLite database and introduces you to concepts in SQL . You will find yourself equipped to design your own database system, administer it, and maintain it. Further, you will learn how to operate your SQLite databases smoothly using SQL commands. You will be able to extend the functionality of SQLite by using its vast arsenal of C API calls to build some interesting, exciting, new, and intelligent data-driven applications. Understand how Xcode, HTML5, and Phonegap can be used to build a cross-platform modern app which can benefit from all these technologies - all through creating a complete, customizable application skeleton that you can build on for your own apps.
Table of Contents (15 chapters)
Learning SQLite for iOS
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Transactions and locks


Transactions and lock states form a part of the makeup of the API and its functions.

Although difficult to control in their entirety, locks and transactions are interlinked with queries within SQLite and most database systems. The key to better transactions involves the programmer writing good SQL code, ensuring that it will perform well, and catering for possible errors and issues during the journey so that the application does not crash or leave the user in the lurch. Another issue with locks will relate to which resources you need. Sometimes, it could be a badly written code that does not use autocommit or is holding an exclusive lock to a table and another part of your process, and you can't update it, as an example. So, it is very important for the programmer to gauge, learn the API, and understand how locking and transaction strategies will work to produce a smooth and good app.

By default, autocommit is used in SQLite where transactions cycles start and end, which...