![]() |
Synchronizing Databases
|
|
Steps of the Refresh OperationThe refresh operation goes through the following steps:
If the refresh completes successfully:
Applying Provisional Transactions at the SourceWhen a provisional transaction is sent to the source, one of the following occurs:
Cloudscape synchronization keeps databases internally consistent and in agreement even if errors occur. NOTE: By using work units, you can control when each type of error is raised. See Error Handling in Work Units for more details. NOTE: You can retrieve failed transaction information from SYSERRORS using the printFailedTransaction method. For more information, see Debugging Synchronized Systems. Scenario 1: The Transaction Applies SuccessfullySince source and target data are similar, provisional target transactions typically apply successfully at the source. If they do:
Scenario 2: A Consistency Error OccursA consistency error occurs when the provisional transaction, if applied at the source, would cause the source to become inconsistent. For example, a consistency error occurs if the transaction violates a source check constraint. Consistency errors typically occur because the source data has changed since this target's last refresh. When consistency errors are encountered during refresh, the offending provisional transaction fails, but the refresh continues. If a provisional transaction is rejected at the source to avoid a consistency violation:
Cloudscape provides utilities to show descriptions of consistency errors. These utilities are in COM.cloudscape.types.ErrorInfo. Removing Records from SYSERRORSIn some cases, you may want to remove records from the SYS.SYSERRORS table. The deleteError method in COM.cloudscape.database.Database can be used to delete a specific error using its errorID. For example, the following ij statement would remove the error from SYS.SYSERRORS whose errorID is a352c053.
SELECT Factory.getDatabaseOfConnection().deleteError( See the Cloudscape Reference Manual for reference information about the SYSERRORS table. Scenario 3: An Environmental Error Occurs and the Transaction Remains ProvisionalWhen a refresh encounters environmental errors at the source, the transaction remains provisional. Examples of environmental errors are:
When an environmental error occurs.
If an environmental error occurs, the system administrator should address the problem immediately. Applying Source Data to the TargetAt the end of a successful refresh operation, the target data is replaced with a copy of the source data. (This is done efficiently; only data changes are actually sent through the wire.) Since source data changes simply overwrite target data, agreement between source and target is assured, no matter what errors occurred during the refresh or how they were handled. Target Refresh FailuresRarely, a refresh may complete successfully at the source, but fail on the originating target during the refresh reply. This can occur when the connection fails between the target and source during refresh, or when a publication has been poorly designed. Connection FailureIf a refresh operation completes at the source but the connection fails during the refresh reply, the refresh fails with an I/O error and the target is left in the same state as before the refresh. Changes made at the source during this refresh endure. The user should refresh again later, and the changed data will reach the target at the target's next successful refresh. The source recognizes changes that were previously applied and does not reapply them. Other FailureIf a refresh operation completes at the source but fails to apply at the target for a reason other than connection failure, the user should contact the system administrator. The target error message indicates this situation. A likely cause of this situation is a foreign key violation at the target, which can be avoided with proper publication design. See Handling Published Foreign Keys for more details. |
|
![]() Cloudscape Version 3.6 For information about Cloudscape technical support, go to: www.cloudscape.com/support/.Copyright © 1998, 1999, 2000 Informix Software, Inc. All rights reserved. |