Handbook
Glossary
with-transaction ( quot -- )
Vocabulary
db
Inputs
quot
a
quotation
Outputs
None
Word description
Calls the quotation inside a database transaction and commits the result to the database after the quotation finishes. If the quotation throws an error, the transaction is aborted.
Definition
USING:
continuations
kernel
namespaces
;
IN:
db
:
with-transaction
( quot -- )
in-transaction?
[
call
]
[
t
in-transaction
[
begin-transaction
[
]
[
rollback-transaction
]
cleanup
commit-transaction
]
with-variable
]
if
;
inline