Object deletion

When an application deletes an XMS object that it created, XMS releases the internal resources that have been allocated to the object.

When an application creates an XMS object, XMS allocates memory and other internal resources to the object. XMS retains these internal resources until the application explicitly deletes the object by calling the object's close or delete method, at which point XMS releases the internal resources. If an application tries to delete an object that is already deleted, the call is ignored.

When an application deletes a Connection or Session object, XMS deletes certain associated objects automatically and releases their internal resources. These are objects that were created by the Connection or Session object and have no function independent from the object. These objects are shown in Table 1. Note: if an application closes a connection with dependent sessions, all objects dependent on those sessions are also deleted. Only a Connection or Session object can have dependent objects.

Deleted object Method Dependent objects that are deleted automatically
Connection Close Connection ConnectionMetaData and Session objects
Session Close Session MessageConsumer, MessageProducer, QueueBrowser, and Requestor objects
Parent topic: Writing XMS applications