Activate automatic controls in sbspaces
The following advantages apply to data that are in sbspaces:
- A database server administrator can back up and restore sbspaces with standard HCL Informix® utilities.
- The database server automatically provides for locking.
- If a transaction fails, the database server automatically rolls back sbspace metadata activity.
If logging is turned on for the smart large object, the
database server does the following:
- Logs transaction activity
- Rolls back uncommitted activity if a transaction fails
You can either advise the user to set logging on with
the onspaces utility or call the appropriate DataBlade
API functions
to set logging.
Important: To provide transaction integrity,
it is recommended that the access method require transaction logging
in sbspaces. It is also recommended that the access method raise an
error if a user attempts to create a virtual table in an unlogged
sbspace.
In the access-method user guide, provide the correct information to describe transaction logging by using the access method. If the access method does not turn on transaction logging, the user guide should explain how to turn on logging for a virtual table in an sbspace.
To enable logging, the access method sets the MI_LO_ATTR_LOG
create-time constant with the DataBlade
API mi_lo_create() or mi_lo_alter() function.
The following example attempts to set the constant that turns on logging
and verifies that the setting succeeded:
mi_integer status;.
status = mi_lo_specset_flags(lo_spec_p, MI_LO_ATTR_LOG);
if(status == MI_ERROR)
{
mi_db_error_raise(NULL,MI_EXCEPTION,
"Unable to activate transaction logging.");
return MI_ERROR;
}
For more information about metadata logging, see the HCL Informix Administrator's Guide.