The mi_lo_close() function

The mi_lo_close() function closes an open smart large object.

Syntax

mi_integer mi_lo_close(conn, LO_fd)
   MI_CONNECTION *conn;
   MI_LO_FD LO_fd;
conn
This value is one of the following connection values:

A pointer to a connection descriptor established by a previous call to mi_open(), mi_server_connect(), or mi_server_reconnect().

A NULL-valued pointer (database server only)

LO_fd
An LO file descriptor of the smart large object to close.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_lo_close() function closes the smart large object that is associated with the LO file descriptor, LO_fd, then frees this file descriptor. This function is the destructor function for an LO file descriptor. A call to the mi_open(), mi_lo_copy(), mi_lo_create(), mi_lo_expand(), or mi_lo_from_file() function returns an LO file descriptor for a smart large object. Once you free an LO file descriptor, you can reuse it for another smart large object. Any open smart large object that you do not explicitly close is automatically closed when the connection closes (when the client connection terminates or the C user-defined routine completes).

When the mi_lo_close() function closes a smart large object, the database server attempts to unlock a locked smart large object if it has a share-mode or update-mode lock. For exclusive locks, the database server does not permit the release of the lock until the end of the transaction. The mi_lo_close() function also deallocates any private-buffer memory that lightweight-I/O allocates.

Server only: The mi_lo_close() function does not need a connection descriptor to execute. If your UDR does not need a valid connection for other operations, you can specify a NULL-valued pointer for the conn parameter to establish a NULL connection. For information about the advantages of a NULL connection, see the Informix® DataBlade® API Programmer's Guide.

Return values

MI_OK
The function was successful.
MI_ERROR
The function was not successful; the session is bad, or an argument is invalid.