ks-transaction added.
This commit is contained in:
+3
-1
@@ -108,7 +108,9 @@
|
|||||||
(define-syntax ks-transaction
|
(define-syntax ks-transaction
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
((_ ks b1 ...)
|
((_ ks b1 ...)
|
||||||
(begin
|
(with-handlers ([exn? (λ (e)
|
||||||
|
(query-exec (keystore-dbh ks) "ROLLBACK")
|
||||||
|
(raise e))])
|
||||||
(query-exec (keystore-dbh ks) "BEGIN")
|
(query-exec (keystore-dbh ks) "BEGIN")
|
||||||
(let ((r (begin b1 ...)))
|
(let ((r (begin b1 ...)))
|
||||||
(query-exec (keystore-dbh ks) "COMMIT")
|
(query-exec (keystore-dbh ks) "COMMIT")
|
||||||
|
|||||||
@@ -121,6 +121,14 @@ Returns raw key-value rows in the form:
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@defform[(ks-transaction [ks keystore?] b1 ...)]{
|
||||||
|
|
||||||
|
Puts b1 ... in a "BEGIN/COMMIT" transaction.
|
||||||
|
It uses with-handlers exn?, so if you raise an exception,
|
||||||
|
it will do a "BEGIN/ROLLBACK" abd re-raise the exception.
|
||||||
|
}
|
||||||
|
|
||||||
@section{Examples}
|
@section{Examples}
|
||||||
|
|
||||||
@subsection{Basic Usage}
|
@subsection{Basic Usage}
|
||||||
|
|||||||
Reference in New Issue
Block a user