The properties of RMO programming objects represent the properties of these replication objects at the server. When creating new replication objects at the server, RMO properties are used to define these objects. For existing objects, the RMO properties represent the existing object's properties, which can be modified only for properties that are writable or settable. Properties can be set on new objects or existing objects.
Setting Properties for New Replication Objects
Setting Properties for Existing Replication Objects
For replication objects that exist at the server, depending on the object, RMO might support the ability to change some or all of its properties. Only writable or settable properties can be changed. Before properties can be changed, either the Load or the LoadProperties method must be called to get the current properties from the server. Calling these methods indicates that an existing object is being modified.
By default, when changing object properties, RMO commits these changes to the server based on the execution mode of the ServerConnection being used. The IsExistingObject method can be used to verify that an object exists at the server before attempting to retrieve or change its properties. For more information about changing the properties of a replication object, see How to: View and Modify Publisher and Distributor Properties (RMO Programming).
Note: |
|---|
|
When multiple RMO clients or multiple instances of an RMO programming object are accessing the same replication object at the server, the Refresh method of the RMO object can be called to update the properties based on the current state of the object at the server.
|
Caching Property Changes
When the SqlExecutionModes property is set to CaptureSql all Transact-SQL statements generated by RMO are captured so that they can be executed manually in a single batch by using one of the execution methods. RMO lets you cache property changes and commit them together in a single batch by using the CommitPropertyChanges method of the object. To cache property changes, the CachePropertyChanges property of the object must be set to true. When caching property changes in RMO, the ServerConnection object still controls when changes are sent to the server. For more information about caching property changes for a replication object, see How to: View and Modify Publisher and Distributor Properties (RMO Programming).
Important: |
|---|
|
Although the ServerConnection class supports declaring explicit transactions when setting properties, such transactions may interfere with internal replication transactions, can produce unanticipated results, and should not be used with RMO.
|