KI_CLOSE
Argument | Enumeration | Purpose |
---|---|---|
handle | Handle to close | |
bClose | TRUE for forced close rather than decrement ref count | |
status | KDB_ERROR_ENUM | Return status |
nRefCount | The new reference count after the close. |
KI_CLOSE
This function closes the table, flat file or result set open on the handle allowing it to be reused. The handle itself still exists and can be freed with a KI_FREE_HANDLE operation. Tables should be closed promptly in order that the access control information is kept up-to-date.
Pooled handles
If the handle refers to a pooled handle, KI_CLOSE will just decrement the reference count on the handle. No actual close is performed even when the new reference count is zero. However the optional bClosed parameter can be set to TRUE to force a close of the table if the reference count is zero and KI_CLOSE_TABLE can be used to close all the handles open on a table that have a zero reference count. In both these cases the pooled handle is also deallocated without the need for a KI_FREE_HANDLE.
The optional nRefCount result argument will be updated with the new reference count after the close.