nsmcp::DatabaseSession method transaction (public)

 <instance of nsmcp::DatabaseSession[i]> transaction script

Defined in /usr/local/ns/tcl/nsmcp/database.tcl

Execute a caller script inside an immediate SQLite transaction. Commit on normal completion and roll back if the script or commit raises an error.

Parameters:
script (required)
Tcl script executed in the documented caller or callback context.
Returns:
The caller script's result on successful commit.

Testcases:
No testcase defined.
Source code:
:execute {BEGIN IMMEDIATE}
try {
    set value [uplevel 1 $script]
    :execute COMMIT
    return $value
} on error {message options} {
    catch {
        :execute ROLLBACK
    }
    return -options $options $message
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: