Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - C and C++ Programming » Developing UltraLite Applications for the Palm OS

Building Expanded Mode applications Next Page

Maintaining state in UltraLite Palm applications

You can save the state of tables and cursors when an application is closed by suspending the connection instead of closing it.

The current state is only stored for tables that are open when the connection object remains open.

Whenever your UltraLite application is closed or the user switches to another application, UltraLite saves the state of any open cursors and tables.

  1. When the user returns to the application, call the appropriate open methods:

  2. Confirm the connection was restored properly by checking that the SQLCODE is SQLE_CONNECTION_RESTORED.

  3. For cursor objects, including instances of generated result set classes, you can do one of the following:

  4. For table objects, including instances of generated table classes, you cannot save a position. You must close table objects before a user moves away from the application, and Open them when the user needs them again. Do not use Reopen on table objects.

Closing a connection rolls back any uncommitted transactions. By not closing connection objects, any outstanding transactions are saved (not committed), so that when the application restarts, those transactions appear and can be committed or rolled back. Uncommitted changes are not synchronized.

Restoring state in UltraLite Palm applications
Saving, retrieving, and clearing encryption keys on Palm OS