Collection Contents Previous Next PDF

UltraLite C/C++ User's Guide

Developing UltraLite Applications for the Palm Computing Platform

Saving 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 not closed, and when the connection object is not closed. This means that, to maintain state, the application should terminate without ever closing the connection object; or exiting the routine that defined the connection object; or assigning the variable for the connection object to nothing or null.

Whenever your UltraLite application is closed, and 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 that 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 either 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 will appear and can be committed or rolled back. Also, uncommitted changes are not synchronized.


Restoring state in UltraLite Palm applications

Collection Contents Previous Next PDF