Cloudsync Commands Reference
Page 8 of 8

REFRESH

Performs a refresh operation. This statement can be executed only on a target database.

Syntax

REFRESH [ PROPERTIES clause ]

PROPERTIES clause

propertyName = CharacterExpression
    [, propertyName = CharacterExpression]*

The refresh operation:

  1. sends provisional target transactions to the source
  2. copies source changes (since this target's last refresh) back to the target

The connection waits until the refresh has completed.

The PROPERTIES clause allows a target application to provide parameters to the source for application-defined refresh authentication. The property values must be String literals; you cannot use dynamic parameters (?). Since those Strings are SQL-J identifiers, delimit those strings if they contain any lowercase characters.

For more information, see Chapter 5, "Refresh Authentication".

NEW: The PROPERTIES clause of the REFRESH command is new in Version 3.6.

You cannot run REFRESH if there is already uncommitted work in the transaction. An application is temporarily blocked if it runs the REFRESH command and there is open work in other transactions.

REFRESH implicitly commits when it completes successfully. You cannot roll back a successful refresh operation.

REFRESH fails with an error in any of the following cases:

  • It is issued at a database that is not a target.
  • The source database has been dropped.
  • The source database cannot be found at its designated address and port.
  • A network communication error occurs.
  • The publication has been dropped.
  • It contains a work unit that has been dropped from the publication.
  • The last refresh was more than one week before the current one (this interval is configurable with the cloudscape.refresh.guaranteedRefreshInterval property).
  • It appears in a transaction that has modified the database. (To be safe, either commit immediately before issuing REFRESH or use auto-commit.)
  • It occurs within Java code called by an SQL statement.

If the target has been cloned, or the source has been copied or restored from a backup, the following cases also cause REFRESH to fail with an error:

  • The source did not create the target's copy file.
  • The source did not perform this target's previous refresh.
  • The source has performed a refresh on a clone of this target.

NOTE: If you upgrade the locale for the source database, the target database picks up the new locale until the first subsequent REFRESH. For more information about localization, see the localization appendix in the Cloudscape Developer's Guide.

Examples

REFRESH

REFRESH PROPERTIES user = "refreshUser", pin = "aksdfh&%"