Persisting Error Queue Information

Meta Data Services Programming

Meta Data Services Programming

Persisting Error Queue Information

If you are programming with COM interfaces, you can retain error queue information while you switch to other error queues or work with other repository objects.

You can access only one repository error queue at a time. When you switch from one error queue to another, several things occur automatically:

  • The IRepositoryErrorQueue interface reference to the first error queue is automatically released.

  • If that reference is the only remaining reference to the interface, the error queue is destroyed.

  • An IRepositoryErrorQueue interface reference to the second error queue is automatically added.

Consequently, if you switch from one error queue to a second error queue and then back to the first error queue, the first error queue is destroyed and then re-created as an empty queue.

To switch between multiple error queues and retain all error queue information

  1. Obtain an IRepositoryErrorQueue interface pointer for the error queue.

  2. Explicitly increment the interface reference count using the AddRef method that is associated with the error queue.

Note  You must repeat these steps for each error queue.

The error queues will be retained as long as you hold these explicit interface references.

To switch back and forth between error queues

  • Use the SetErrorQueue method of the IReposErrorQueueHandler interface. When the error queue information is no longer needed, use the Release method to remove the explicit interface references.

See Also

Accessing Error Information at the COM Level

Error Handling Overview

IRepositoryErrorQueue Interface

IReposErrorQueueHandler Interface