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.

### Verifying Synchronization

Panorama’s synchronization system is efficient and reliable at distributing data to all the computers connected and reliable. If you have any question about whether the data on your computer is up-to-date, you can use the Check Synchronization command in the Sharing Icon & Context Menu.

This command starts by asking you how comprehensive you want it to be in verifying the data. The verification process is time consuming for large amounts of data, and usually it’s only necessary to verify recent changes. The default is to verify the 25 most recent changes, but you can adjust this as needed.

When you press the Check button, Panorama will verify that the recent changes match between the server and the client. If everything matches, Panorama will display a notification that the synchronization is verified.

If the recent changes don’t match, Panorama will display a dialog listing the recent changes that don’t match between this computer and the server.

The dialog shown above doesn’t indicate that there’s a problem, it simply means that there have been changes made to the database since the last time this computer was synchronized. Press the Synchronize button to download these changes to this computer.

If one or more time stamps are displayed in red, as shown below, that does indicate a possible problem.

This means that Panorama thinks it should have already synchronized this record with the server, but it hasn’t. (Note: We don’t know of any way this could happen, we damaged this database of purpose to make the screen shot above.) The regular File>Synchronize menu command won’t fix this problem, but pressing the Synchronize button in this dialog should fix it (this button explicitly makes sure that the records displayed are all synchronized). The problem can also be fixed by presing the Download button, which downloads the entire database from the server. However, the download operation may be much slower than synchronizing.

You should never see this message that there are changes that have not been uploaded to the server. (Once again, we intentionally damaged our database to make this screen shot.)

If you do encounter this message, you can try manually uploading the indicated records. See Manually Uploading a Record at the bottom of the Record Locking and Editing Shared Data page to learn how to do this. Alternately, you may want to disconnect the database from the server and re-upload it (but this may cause changes made by other users to be lost.)

#### Automatically Verifying Synchronization

The previous section described how to manually verify synchronization. Panorama can also be configured to automatically verify every time synchronization is performed. This should not be necessary, and may add a slight delay on both the client and the server, but the delay is generally small and this can be reassuring if you have any doubt about the synchronization process. (Note: This option is enabled on a client-by-client basis, so enabling verification on one client does not automatically enable it on other clients of the same server.)

To enable automatic verification of synchronization, open the Preference>Client panel and use the pop-up menu to enable verification. You can choose how many recent changes you want to verify each time synchronization is performed:

Once this option is enabled, Panorama will automatically verify each time a synchronization is performed. If there’s a problem, a notification saying Synchronize verification failed! will appear (you must have notifications enabled for Panorama). You can click on this notification to see more information about the synchronization problem – see the previous section for details about this Synchronization Status dialog.

See Also

- Automatic Record Numbering in a Shared Database -- generating unique numbers across multiple users.
- popupsharingmenu -- pops up a menu for the toolbar sharing icon.
- Record Locking and Editing Shared Data -- coordinating data entry across multiple simultaneous users.
- setbannericon -- sets the icon on the right side of the toolbar banner.
- Sharing Icon & Context Menu -- operation of the sharing icon and pop-up menu (in the toolbar).
- Working with Sharing Disruptions -- dealing with network & power outages, disconnections, and other anomalies.
- 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.