The mi_module_lock() function

The mi_module_lock() function prevents the shared-object file of the current UDR from being unloaded.

Syntax

mi_integer mi_module_lock(lock_flag)
   mi_integer lock_flag;
lock_flag
The value to set the module-lock flag for the shared-object file of the current UDR. This flag can have the following values:
MI_TRUE
The value sets the module-lock flag to prevent the routine manager from unloading the shared-object file.
MI_FALSE
The value unsets the module-lock flag to indicate that the routine manager can unload the shared-object file when necessary. This action does not force an unload of the shared-object file.
Valid in client LIBMI application? Valid in user-defined routine?
No Yes
Important: This advanced function can adversely affect your UDR if you use the function incorrectly. Use it only when no regular DataBlade® API function can perform the task you need done.

Usage

The mi_module_lock() function sets the module-lock flag to the value that lock_flag specifies. The module-lock flag indicates whether to lock the shared-object file in the memory of the database server. When the module-lock flag is MI_TRUE, the routine manager does not allow the shared-object file to be unloaded for any reason. This function is useful for preventing arbitrary unloading of shared-object files, which necessitates reinitialization the next time any UDR on the shared-object file is used.

Return values

MI_OK
The function was successful.
MI_ERROR
The function was not successful.