Releasing the Pooled Object

When you have finished using the pooled object, you generally should NOT do a Bye() or Close() on the object. If you do so, the next client to get the object hasto connect and login again, thus negating much of the reason for pooling the object in the first place.

If you encounter a serious error while using the object, it is a good idea to Close it, so that the next user is forced to connect and log-in again.

Technically, you do not have to release or destroy the pooled object if you are using the .NET Framework environment, as itis garbage collected and released by the system when it goes out of scope, but in reality, this means that the object might be kept much longer than you really need it.

Given this, it is good practice to explicitly release the object in your client.

To do this, call the static method ServicedComponent.DisposeObject(object).

For example:

call - ServicedComponent.DisposeObject (objPooled);