Lock a shared-object file in memory

If the set of UDRs in a shared-object file requires a lot of initialization or uses external resources, it can be costly to have the routine manager continually load and unload this shared-object file. To prevent the routine manager from unloading a shared-object file, use the mi_module_lock() function.

When you call mi_module_lock() with an argument of MI_TRUE, you set the module-lock flag, which locks the shared-object file in memory. Therefore, the routine manager does not allow the shared-object file to be unloaded for any reason.

This feature enables a DataBlade® (or group of related UDRs) to prevent its shared-object file from being unloaded in any of the following cases:
  • On execution of the DROP FUNCTION, DROP PROCEDURE, DROP ROUTINE, or DROP DATABASE statements
  • In various transaction rollback scenarios