Contents Index Using the persistent name Example: Using the persistent name to maintain state information

UltraLite for MobileVB User's Guide
  Understanding UltraLite for MobileVB Development
    Maintaining database state on Palm OS

Closing connections and tables


If you explicitly close a ULTable object (by calling its Close method), the current row is not maintained. If you explicitly close a ULConnection object, all the ULTable objects are implicitly closed, so the current row for all the tables is not maintained.

The current state is only stored in the state PDB for tables that have not been closed, and when the ULConnection object's Close method is not called. This means that the application should terminate without ever calling Close on the ULConnection object; or, the routine that defined the ULConnection object is exited; or, the variable for the ULConnection object is assigned to Nothing.

For applications with auto-commit turned off, closing a connection rolls back any uncommitted transactions. By not closing the ULConnection object, the 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.


Contents Index Using the persistent name Example: Using the persistent name to maintain state information