DataBlade Developers Kit User's Guide
Chapter 8: Testing and Debugging DataBlade Modules on UNIX
Home
Contents
Index
Master Index
New Book
Using the Shared Object File
A DataBlade module exists in the Informix database server as a shared object. The shared object file is loaded into the database server the first time one of its routines is executed after the database server is started. The shared object file is unloaded every time the database server is stopped.
Replacing a Shared Object File
When a DataBlade module is loaded onto an Informix database server, the database server stores it in the database server memory map. Therefore, if you overwrite a shared object file while it is loaded in the database server, you must stop and restart the database server to unload the old shared object file and load the new one.
Warning:
If you do not stop and restart the database server after replacing a shared object, the database server might fail when you call a DataBlade module routine.
To unload a module without restarting the Informix database server, you must drop all objects in the module, using the
SQL
DROP
statement. After all objects in the module have been dropped and all instances of the routines have finished executing, the symbol references to the DataBlade module shared object are invalidated and a message is recorded in the log file.
After the module is unloaded, replace the shared object file and load it into the database.
Shared Object File Ownership and Permissions
Shared object files must be owned by the user
ID
that runs the Informix database server. In a production installation, the Informix database server runs as user
informix
and shared object files are owned by user
informix
.
The Informix database server only loads a shared object file if it is marked as read-only. The
project
.bld
file is marked as read-only by the makefile BladeSmith generates.
Important:
If you receive a -9793 error when you try to execute a routine in the shared object file, your shared object file is not marked as read-only.
Symbols in Shared Object Files
Undefined symbols in a shared object file are resolved with Informix Dynamic Server when the file is loaded. If a symbol is missing, the load fails on the first execution of the user-defined routine, and a message is written in the server log file.
You cannot resolve undefined symbols in a shared object file using definitions in another shared object file.
A symbol defined in a shared object file and Informix Dynamic Server behaves in one of two ways:
If the symbol referenced in the shared object file is in the same source file that references it, the debugger accesses the symbol in the shared object file.
If the shared object file includes more than one source file and there is a cross-file symbol reference, the symbol is resolved to Informix Dynamic Server. These symbols are listed as unresolved when you link the shared object file.
Important:
Although most of the unresolved symbols listed when you link the DataBlade module shared object file are resolved when the database server loads the shared object, check for mistyped symbols; these are not resolved.
DataBlade Developers Kit User's Guide
, version 3.6
Copyright © 1998, Informix Software, Inc. All rights reserved.