Shared Database Synchronization
Since Panorama database sharing uses duplicate databases spread out all over the network, or possibly all over the world, synchronization is the key to keeping all the data in order. Synchronization happens automatically whenever a shared database is opened, and can also be done “on command” at any time from the File menu.

Synchronizing updates the local copy of the database with the server. When you synchronize a database, you may see any of these changes happen on the local database:

- Existing records may change (because they were edited by other users).
- New records may be added (because they were added by other users).
- Existing records may be deleted (because they were removed by other users).
- The order (top to bottom) of records may change, and summary records will be removed.
- If a subset of records is visible, all records will now be selected (as if you had performed a Select All command).

These changes all happen simultaneously, so you won’t see individual records appearing, changing, and deleting during this process, just the finished result.

### Synchronization and Record Order

The last point in the list above merits more attention. If you have been using the single user version of Panorama, you are accustomed to the record order staying the same each time you open the file. When working with multi-user (shared) databases, that isn’t the case. Each time the database is synchronized, the order of the data may (and probably will) change.

For example, suppose you have used the Sort Down command to rank the listings database by asking price, so that the highest price properties appear at the top.

When you synchronize your local copy of the database, the data is no longer sorted by asking price. In fact the sort order of the database after synchronization is unknown.

To rearrange the updated data back into sorted order, simply use the appropriate Sort command again (fortunately, Panorama’s RAM based sorting is very fast).

The same principle applies to grouping and summary records. For example, suppose you open the Summarize & Analyze Dialog and set up an analysis like this like this:

When the Analyze Data button is pressed, this analysis will display summary records for the cities in this database to show them ranked by average asking prices, as shown below. (If you are not familiar with this process, see Summary Records and Summarize & Analyze Dialog.)

Usually when you are done with an analysis like this, you use the Remove All Summaries command to get rid of the summary records (see Deleting All Summary Records). However, another way to remove all the summary records is to chooseSynchronize Data from the File menu. In the process of synchronizing the local database with all of the changes made by other users, it also removes any of the summary records, leaving only the updated data records.

If you are going to frequently produce a summary or report, you can automate the process with a procedure that starts by synchronizing before it does any data processing. This ensures that your summary or report will contain the latest, most up-to-date information. Here is a procedure that synchronizes then performs the same analysis described above.

    synchronize
    field City
    groupup
    field Asking
    average
    outlinelevel 2
    sortdown
    firstrecord

An easy way to write this code is to turn on the Procedure Recorder and then run the Summarize & Analyze Dialog. The recorder will write the code for you.

### Regular Synchronization vs. Downloading Data

When Panorama synchronizes with the server, it transfers only the records that have actually changed. These updated records are merged with the existing unchanged records in the local database. However if you hold down the Option key when you choose the Synchronize Data command, the command changes into Download Data.

The Download Data command will transfer the entire database from the server to the local database, including both changed and unchanged records. Theoretically you should never need to download instead of synchronizing, but the option is there if for any reason you think a database is not synchronizing properly. You can also perform this operation in a procedure by using the forcesynchronize statement.

See Also

- Automatic Record Numbering in a Shared Database -- generating unique numbers across multiple users.
- Record Locking and Editing Shared Data -- coordinating data entry across multiple simultaneous users.
- Working With Summary Records in a Shared Database -- summary records are not shared between users.

History

Version | Status | Notes
10.2 | New | New in this version.