A computer program product and system for deleting objects used or managed
by an application or application instance is disclosed. First program
instructions identify the objects. Second program instructions write an
executable program to delete the objects which were identified. There are
wide variety of objects than can be deleted such as local queues, alias
queues, remote queues, security objects, channel objects, process
objects, etc. The first program instructions identify a queue object and
determine whether the queue object contains a work item. If so, the
second program instructions write into the executable program a command
to clear the work item. A computer program product, system and method for
deleting a queue object managed by an application or application instance
is also disclosed. Channels used by other applications or other
application instances to lock and access a queue defined by the queue
object are identified. Then, the channels are stopped. Afterwards, the
work item(s) on the queue are cleared and then the queue object is
deleted.