www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Virtuoso Functions Guide

Administration
db.dba.vacuum
user_change_password
user_create
user_drop
user_get_option
user_grant_role
user_revoke_role
user_role_create
user_role_drop
user_set_option
user_set_qualifier
__dbf_set
cfg_item_count
cfg_item_name
cfg_item_value
cfg_section_count
cfg_section_name
cfg_write
checkpoint_interval
disconnect_user
fk_check_input_value...
key_estimate
log_enable
log_text
prof_enable
prof_sample
server_root
status
sys_lockdown
sys_stat
system
trace_status
user_set_password
virtuoso_ini_path
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Phrases
RDF data
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
VAD
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web & Internet
XML
XPATH & XQUERY

Functions Index

log_enable

controls transaction logging and in-statement autocommit
log_enable ([in bits integer in quiet integer]);
Description

The log_enable function allows turning off or on regular transaction logging or autocommit after every changed row. The parameter bits is a bitmask. Two bits that are in use in current versions are 1 and 2. When bit 1 is not set (e.g. parameter value 0) then the function call terminates logging of DML statements inside the calling transaction. A value of 1 resumes logging of DML statements. If bit 2 is set then automatic commits take place after every change in every row in every DML statement. Thus a parameter value of 2 disables logging and enables row-by-row autocommit. A value of 3 enables row-by-row autocommit and enables logging. While log on and off setting alone is reset at the end of the transaction so that one does not end up with logging disabled by accident, the row-by-row autocommit mode causes the setting to be permanent inside the calling connection or web request. That is, for a SQL client the setting stays in effect until changed or disconnected and for a web request it stays in effect until the request is completed.

The function do nothing if the bits is NULL. The function also do nothing when called inside atomic section.

The function always returns the bitmask that describes old configuration of the log.

Attempt to disable transaction log that is disabled already result in an error. If the second parameter is passed and it is not equal to zero then the error is suppressed (and it's still possible to turn on or off autocommit).

Using this function one can create situations where a transaction's outcome would be different from the outcome of doing a roll forward of the transaction log.

There are rare cases where it is more efficient to log an action in the form of a procedure call instead of logging the effects of the procedure on a row by row basis. This is similar in concept to replicating procedure calls but applies to roll forward instead.

See Also

log_text