Saving or Discarding Changes

When you set properties on an item, no changes are actually recorded to the COM+ catalog until you explicitly save changes. You do this using the SaveChanges method on the COMAdminCatalogCollection object for the collection containing the item.

If you want to discard changes that have not yet been committed, you can call the Populate method on the COMAdminCatalogCollection object. This reads in all persistent data from the COM+ catalog for all items in the collection, effectively deleting any pending changes.

When you use SaveChanges, any inconsistencies in property settings that you have chosen result in an error, and SaveChanges fails to write the object that returned the error. All properties on a given item either are written or fail to be written as a whole.

However, when write errors occur, they might not be due to incompatible settings; some other failure might have occurred. You need to inspect the details of the failure to be certain. For more information, see Handling COM+ Administration Errors and Interdependencies Between Properties.

As a general rule, the more changes you attempt to save at once, particularly changes to multiple objects, the more likely you are to get an error and the more difficult it is to track down.

Additionally, between calls to Populate and SaveChanges, you do not have a lock on the items in the collection; contention is possible. For more details, see Getting and Setting Properties.

Getting and Setting Properties

Interdependencies Between Properties

Querying for Available Properties