Developing UltraLite Applications for the Palm Computing Platform
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.
When the user returns to the application, call the appropriate open methods:
For the Static C++ API, call the following functions:
For embedded SQL, call the following functions:
For the C++ Component, call the following functions:
Confirm that the connection was restored properly by checking that the SQLCODE is SQLE_CONNECTION_RESTORED.
For cursor objects, including instances of generated result set classes, you can do either of the following:
Ensure that the object is closed when the user switches away from the application, and call Open when you next need the object. If you choose this option, the current position is not restored.
Do not close the object when the user switches away, and call Reopen when you next need to access the object. The current position is then maintained, but the application takes more memory in the Palm when the user is using other applications.
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
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.