Name

ADD-TRANSACTION-ROLLBACK-HOOK — Specify hooks to be run when rolling back changes.Function

Syntax

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

Arguments and Values

rollback-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 rollback hooks for database.

Description

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

Examples

(start-transaction)
=> NIL 
(add-transaction-rollback-hook #'(lambda () (print "Successfully rolled back.")))
=> (#<Interpreted Function (LAMBDA # #) {48E37C31}>)
(rollback)
"Successfully rolled back." 
=> NIL      
      

Side Effects

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

Affected by

None.

Exceptional Situations

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

See Also

commit
rollback
add-transaction-commit-hook

Notes

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