25.01.2015 Views

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• classname is a quoted string the name of class whose instances are receiving GUIDs,<br />

such as "Sample.Person".<br />

• displayoutput is an integer where zero specifies that no output is displayed and a nonzero<br />

value specifies that output is displayed.<br />

and where the method returns a %Status value.<br />

4. Recompile the class.<br />

5. Put a copy of the database on each site.<br />

Running an Update<br />

17.2.2 The Update Itself<br />

This involves updating one database from another. The database providing the updates is<br />

known as the “source database” ; the database receiving the updates is known as the “target<br />

database.” To perform the actual synchronization, the process is:<br />

1. Each time you wish to synchronize the two databases, go to the instance with the source<br />

database. On the source database, create a new SyncSet using the %New method of the<br />

%SYNC.SyncSet class:<br />

Set SrcSyncSet = ##class(%SYNC.SyncSet).%New("unique_value")<br />

The integer argument to %New, unique_value, should be an easily identified, unique<br />

value. This ensures that each addition to the transaction log on each site can be differentiated<br />

from the others.<br />

2. Once you have created the SyncSet, you can invoke the AddTransactions method of<br />

the SyncSet class:<br />

Do SrcSyncSet.AddTransactions(FirstTransaction,LastTransaction,ExcludedDB)<br />

where<br />

• FirstTransaction is the first transaction number to synchronize.<br />

• LastTransaction is the last transaction number to synchronize.<br />

• ExcludedDB specifies a namespace within a database whose transactions are not<br />

included in the SyncSet.<br />

This method collects the synchronization data and puts it in a global, ready for export.<br />

If you wish to simply synchronize all transactions since the last synchronization, invoke<br />

the method in the following form:<br />

<strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong> 151

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!