solidDB Help : Replication : Advanced Replication : Maintaining a distributed system : Upgrading schemas in a distributed system by using Maintenance Mode features : Updating a distributed schema : Example: Specifying and distributing a schema upgrade : Detecting the need for an upgrade to the replica schema
  
Detecting the need for an upgrade to the replica schema
If the master and replica databases have each defined their version by setting the bulletin board parameter SYNC_APP_SCHEMA_VERSION, and if the master and replica schema versions do not match, then an error is returned when the replica database attempts to synchronize with the master database. Typically, the data is synchronized by executing an SQL script in the replica database, for example:
MESSAGE syncmsg BEGIN ;
MESSAGE syncmsg APPEND PROPAGATE TRANSACTIONS ;
MESSAGE syncmsg APPEND REFRESH MYPUBLICATION ;
MESSAGE syncmsg END ;
COMMIT WORK ;
MESSAGE syncmsg FORWARD TIMEOUT 10 ;
COMMIT WORK ;
If the version name of the master database does not match the version name of the replica database, then the following statement:
MESSAGE msgname FORWARD
fails with the following error:
25092 - User version strings are not equal in master and replica, operation failed.
Although sending the message to the master database failed, the message stays persistent in the replica database. After the replica schema is upgraded to match the master schema, the failed message can be resent to the master database by using the MESSAGE FORWARD statement.
After the need for an upgrade to the replica schema upgrade is detected, the administrator of the replica database needs to upgrade the schema to the new version by using the version upgrade scripts that were developed for that replica database, see Upgrading the replica schema.
Go up to
Example: Specifying and distributing a schema upgrade