Name

ADD-TRANSACTION-COMMIT-HOOK — Specify hooks to be run when committing changes.Function

Syntax

      add-transaction-commit-hook commit-hook &key database => result

Arguments and Values

commit-hook

A designator for a function with no required arguments.

database

A database object. This will default to the value of *default-database*.

result

The list of currently defined commit hooks for database.

Description

Adds commit-hook, which should a designator for a function with no required arguments, to the list of hooks run when commit is called on database which defaults to *default-database*.

Examples

(start-transaction)
=> NIL 
(add-transaction-commit-hook #'(lambda () (print "Successfully committed.")))
=> (#<Interpreted Function (LAMBDA # #) {48E2E689}>)
(commit)
"Successfully committed." 
=> NIL
      

Side Effects

commit-hook is added to the list of commit hooks for database.

Affected by

None.

Exceptional Situations

If commit-hook has one or more required arguments, an error will be signalled when commit is called.

See Also

commit
rollback
add-transaction-rollback-hook
with-transaction

Notes

add-transaction-commit-hook is a CLSQL extension.