Public Member Functions | |
_.Library.Status | OnClose () |
This callback method is invoked by the <METHOD>Close</METHOD> method to. More... | |
_.Library.Status | OnNew (_.Library.RawString initvalue) |
This callback method is invoked by the <METHOD>New</METHOD> method to. More... | |
_.Library.Integer | AddObject (_.Library.String class, _.Library.String id, _.Library.Integer fileop, _.Library.String guid) |
Add an object to the current SyncSet. More... | |
_.Library.Integer | AddTransactions (_.Library.Integer iTranLast, _.Library.Integer iTranEnd, _.Library.List lExclude, _.Library.Integer TNumber) |
Add Library.ObjectJournalTransactions to the current SyncSet. More... | |
_.Library.Status | Clear () |
This method should be used for data removal when the syncset is no longer needed. More... | |
_.Library.Status | ExportFile (_.Library.String file, _.Library.String qspec, _.Library.Boolean bUpdate) |
_.Library.Integer | FindLastGUID (_.Library.String guid) |
Find the last synchronization record for a particular GUID. | |
_.Library.ArrayOfObjects | GetLatestUnresolved () |
Return the pointer to the last unresolved object in the sync set. More... | |
_.Library.String | GlobalName () |
This method returns the name of the global used for the sync set. | |
_.Library.Status | Import (_.Library.String file, _.Library.Integer lastSync, _.Library.Integer maxTS, _.Library.String qspec, _.Library.String errorlog, _.Library.Integer diag, _.Library.Integer trace) |
_.Library.Status | OpenFile (_.Library.String file, _.Library.String qspec, errorlog) |
Open a file containing a sync set global and load it into the current sync set global. More... | |
_.Library.Status | QueueError (_.Library.Integer pTranPtr, _.Library.Status pStatus) |
Queue an error to the current sync set. | |
_.SYNC.SyncSetObject | UnresolvedFirst () |
Return the pointer to the first unresolved object in the sync set. More... | |
_.SYNC.SyncSetObject | UnresolvedNext () |
Return the pointer to the next unresolved object. More... | |
![]() | |
_.Library.Status | OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount) |
This callback method is invoked when the current object is added to the SaveSet,. More... | |
_.Library.Status | OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned) |
This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More... | |
_.Library.Status | OnNew () |
This callback method is invoked by the <METHOD>New</METHOD> method to. More... | |
_.Library.Status | OnValidateObject () |
This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More... | |
Public Attributes | |
FilterObject | |
More... | |
ResolveConflictEnv | |
More... | |
SyncSystem | |
This is the sysID of the system that produced the SyncSet. More... | |
Unresolved | |
Unresolved is set to point to the first unresolved object in the sync set once. More... | |
sId | |
Sync Set ID More... | |
Private Attributes | |
__Exclude | |
More... | |
__FirstTransaction | |
More... | |
__LastTransaction | |
More... | |
Additional Inherited Members | |
![]() | |
CAPTION = None | |
Optional name used by the Form Wizard for a class when generating forms. More... | |
JAVATYPE = None | |
The Java type to be used when exported. | |
PROPERTYVALIDATION = None | |
This parameter controls the default validation behavior for the object. More... | |
For information on this class, see Using Object Synchronization.
ObjectScript provides a toolkit for synchronizing objects of selected types between namespaces containing compatible type classes. The core of the synchronization toolkit is the SyncSet. A SyncSet contains all the objects of selected types that have been filed in the local database from a defined starting time up to an ending time. "Time" in the context of synchronization means a sequencing value and is not an "hours-minutes-seconds" value. Object Synchronization consists of three primary tasks. The first task is to build the SyncSet. That task involves determining which objects are to included in the SyncSet. SYNC uses a transaction journal for that purpose. The transaction journal is implemented as Library.ObjectJournalTransaction. Any persistent or serial class that declares the class parameter OBJJOURNAL as true will record all filing events in Library.ObjectJournalTransaction. The second task is to add changed objects to the SyncSet. The most common mechanism for performing this task is to retrieve the object state from the system journal using information recorded in Library.ObjectJournalTransaction. This mechanism allows historical object data to be included in the SyncSet. If the system journal is not available, there is a provision to include the current object state. The third task is to import the SyncSet into the namespace being synchronized. This involves loading the SyncSet global into the target namespace and then importing each object contained in the SyncSet. If an object being imported already exists in the target namespace then the timestamp for the imported object is compared to the timestamp of the existing object. If a conflict is detected then user implemented code is called to resolve the conflict. This is essentially an optimistic concurrency mechanism. If the conflict is not resolved successfully then a concurrency error is reported and the object is not synchronized.
_.Library.Status OnClose | ( | ) |
This callback method is invoked by the <METHOD>Close</METHOD> method to.
provide notification that the current object is being closed.
The return value of this method is ignored.
Reimplemented from RegisteredObject.
_.Library.Status OnNew | ( | _.Library.RawString | initvalue | ) |
This callback method is invoked by the <METHOD>New</METHOD> method to.
provide notification that a new instance of an object is being created.
If this method returns an error then the object will not be created.
_.Library.Integer AddObject | ( | _.Library.String | class, |
_.Library.String | id, | ||
_.Library.Integer | fileop, | ||
_.Library.String | guid | ||
) |
Add an object to the current SyncSet.
This method can be used to force an object to be included in the
SyncSet when it isn't recorded in the ObjectJournal. It should not be used for normal situations since the ObjectJournal is expected to be complete. Normally, an object that is added to the SyncSet is a versioned object meaning that the object state is recovered from history (normally, from the system journal). AddObject causes the object as it currently exists in the extent to be added to the SyncSet, breaking the natural chronology of the SyncSet. Parameters: class - the object's type class; id - the object's ID value; fileop - the filing operation that caused this object to be added to the sync set 0 - update 1 - insert 2 - delete guid - the object's GUID
_.Library.Integer AddTransactions | ( | _.Library.Integer | iTranLast, |
_.Library.Integer | iTranEnd, | ||
_.Library.List | lExclude, | ||
_.Library.Integer | TNumber | ||
) |
Add Library.ObjectJournalTransactions to the current SyncSet.
Each transaction in the ObjectJournalTransaction extent is identified
by an integer that is incremented for each new transaction. This ID assignment mechanism places transactions in chronological order, that is, the order in which the transactions are created. Transactions are expected to be in that order when later imported and sync'ed into another namespace. This method adds a range of transactions, beginning with iTranLast and ending with iTranEnd. The TNumber argument, if specified and is not zero, limits the number of transactions added. When that number of transactions has been added the method will return to the caller, even if the iTranEnd value has not yet been reached. The LastTransaction property is set to the ID of the last transaction added to the SyncSet.
_.Library.Status Clear | ( | ) |
This method should be used for data removal when the syncset is no longer needed.
It deletes all the persistent data
and makes impossible further usage of the object.
_.Library.Status ExportFile | ( | _.Library.String | file, |
_.Library.String | qspec, | ||
_.Library.Boolean | bUpdate | ||
) |
For information on qSpec, see
_.Library.ArrayOfObjects GetLatestUnresolved | ( | ) |
Return the pointer to the last unresolved object in the sync set.
This is only valid if Import() has been run to completion before calling this method.
_.Library.Status Import | ( | _.Library.String | file, |
_.Library.Integer | lastSync, | ||
_.Library.Integer | maxTS, | ||
_.Library.String | qspec, | ||
_.Library.String | errorlog, | ||
_.Library.Integer | diag, | ||
_.Library.Integer | trace | ||
) |
This method synchronizes each object contained in the sync set with the current database. Each object is first checked for concurrency. Concurrency conflicts occur when the object is modified on the local system after the object was last synchronized with the remote system where the sync set originated. If a concurrency conflict is detected, the object is passed to the ResolveConcurrencyConflict method in <class>Library.SwizzleObject</class>. If the conflict cannot be resolved, the object is requeued for later processing and the concurrency error is reported in the %SERR error log. Otherwise, the object is synchronized by passing it to the SyncObjectIn method in <class>Library.SwizzleObject.</class>. If the synchronization fails, then the object is requeued for later processing.
There are two types of common synchronization errors. The first is an unresolved dependency. This type of error occurs when an object references another object and the referencing property is part of a REQUIRED constraint. That means the object cannot be saved until the reference can be resolved. This problem is often caused by a reference to an object that is in the sync set but has not yet been processed. The second type of problem is an unresolved reference. This type of problem occurs in the same was as an unresolved dependency but the reference is not required in order for the object to be saved. An object with an unresolved reference is partially synchronized and only the reference is requeued for later processing.
Once all of the objects in the sync set have been processed, the Import method attempts to synchronize all objects that were requeued. During this phase, all of the unresolved dependencies and references are expected to be resolved. Any objects that fail to synchronize during this phase are left in an unresolved state. Unresolved objects and errors reported during synchronization can be accessed by using the <query>Unresolved</query> query or the <query>Errors</query> query.
When all of the objects contained in the Sync Set have been processed the time stamps in the <class>SYNC.SyncTime</class> class are updated using the maxTS value.
Formal parameters:
file | The name of a file containing a sync set. If a file name is specified, then that file will be loaded into the global. If no file is specified, then the global is expected to already exist in the current namespace. |
lastSync |
An integer value indicating the SyncTime value when this System.Namespace was last synchronized with the System.Namespace that generated the sync set being imported. If this value is not specified, then it will be retrieved from <class>SYNC.SyncTime</class> |
maxTS |
The highest transaction ID contained in the sync set. It is used to set the rTrn property in the <class>SYNC.SyncTime</class> class. This value is not used for any purpose during import and is maintained for informational purposes only. This value is specified by the user and is expected to be the ID of the last <class>Library.ObjectJournal</class> object included in the sync set. See the <class>SYNC.SyncTime</class> for more information on the rTrn and lTrn properties. |
qspec |
Option flags. This formal argument is maintained for backward compatibility only. |
errorlog |
Array of errors encountered during import. These are not errors encountered during synchronization but are errors reported doing tasks like opening the file. |
diag |
If true, then Import will display status information on the current device. |
trace |
If true, then Import will record all import activity in the sync set global under the "Trace" subscript. |
_.Library.Status OpenFile | ( | _.Library.String | file, |
_.Library.String | qspec, | ||
errorlog | |||
) |
Open a file containing a sync set global and load it into the current sync set global.
Files containing sync set globals are typically in GOF format and are produced by exporting a sync set on another system.
_.SYNC.SyncSetObject UnresolvedFirst | ( | ) |
Return the pointer to the first unresolved object in the sync set.
This is only valid if Import() has been run to completion before calling this method.
_.SYNC.SyncSetObject UnresolvedNext | ( | ) |
Return the pointer to the next unresolved object.
This is only valid if Import() has been run to completion before calling this method and ..UnresolvedFirst() has been called to initialize the unresolved object iterator.
|
private |
FilterObject |
|
private |
|
private |
ResolveConflictEnv |
SyncSystem |
This is the sysID of the system that produced the SyncSet.
Unresolved |
Unresolved is set to point to the first unresolved object in the sync set once.
Import() has completed. If there are no unresolved objects then this value will be empty (not > 0).
sId |
Sync Set ID
This is a string value used to identify the Sync Set object. This value is used as the suffix to the global name root of ^OBJ.SYNC.. For example, if the <property>sId</property> is set to the integer 1 then the global name will be ^OBJ.SYNC.1.