FreeStmtHandleCache method

Applies to
TIB_Connection

Declaration
Procedure FreeStmtHandleCache(MaxHandles: integer );

Description
This method will trim up the number of statement handles in the cache.

This should be done when a large form or many forms with lots of statements have been freed and there is a good possibility that they will not get used for a while. It is merely a matter of conservation since the server is holding resources for each statement handle that is in the cache. It has proven to make the forms free much more quickly when is all they have to do is pass the live handle to the connection instead of deallocating immediatly.

I hope to include some timer driven worker threads that will periodically peruse through the various caches and buffers of IBO and trim things up according to some tuning parameters which I will put together.

When droping a table or other resources it is possible to get an "object in use" error when committing the change if a cached statement handle was using the resource but I have checked for this problem and I automatically do a call to this method and try the commit again which will be successful if a cached handle was holding the resources. So, the "Object in Use" error should be much less frequent in IBO now. It will happen only if another user is holding the resource.

I'm hoping that I can figure out a way to propogate a notice to other users to free up their extra server resources as well.