Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   Database Access > Executing User-Defined Routines > Calling UDRs with the Fastpath Interface >

Releasing Routine Resources

A function descriptor for a UDR has a memory duration of PER_COMMAND. Therefore, a function descriptor remains active until one of the following events occurs:

To conserve resources, use the mi_routine_end( ) function to explicitly deallocate the function descriptor once your DataBlade API module no longer needs it. The mi_routine_end( ) function is the destructor function for a function descriptor. It frees the function descriptor and any resources that are associated with it.

The following call to mi_routine_end( ) explicitly releases the resources for the fdesc function descriptor that the code in Figure 51 and Figure 54 uses:

if ( mi_routine_end(conn, fdesc) != MI_OK )
   /* handle error */
   ...

Important:
It is recommended that you explicitly deallocate function descriptors with mi_routine_end( ) once you no longer need them. Otherwise, these function descriptors remain until the end of the associated SQL command.
Server Only

If your UDR accesses any session-duration function descriptors, these descriptors have a memory duration of PER_SESSION. Therefore, they remain active until the end of the session. You can explicitly deallocate them with mi_routine_end( ).

Warning:
Session-duration function descriptors are an advanced feature of the
DataBlade API. Do not use session-duration function descriptors unless regular function descriptors (PER_COMMAND) cannot perform the task you need done. For more information, see Obtaining a Session-Duration Connection Descriptor.
End of Server Only
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]