Unwind the stack when handling transaction errors
As this avoids trying to suspend while the stack is in a unpredictable state.
This commit is contained in:
parent
14de1667b1
commit
97a01853b8
1 changed files with 3 additions and 1 deletions
|
|
@ -216,13 +216,15 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(exec-query conn "ROLLBACK;"))
|
(exec-query conn "ROLLBACK;"))
|
||||||
#:unwind? #t)
|
#:unwind? #t)
|
||||||
|
;; TODO Include the stack in the exception via knots
|
||||||
(raise-exception exn))
|
(raise-exception exn))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let ((result (f conn)))
|
(let ((result (f conn)))
|
||||||
(exec-query conn (if always-rollback?
|
(exec-query conn (if always-rollback?
|
||||||
"ROLLBACK;"
|
"ROLLBACK;"
|
||||||
"COMMIT;"))
|
"COMMIT;"))
|
||||||
result))))
|
result))
|
||||||
|
#:unwind? #t))
|
||||||
|
|
||||||
(define (check-test-database! conn)
|
(define (check-test-database! conn)
|
||||||
(match (exec-query conn "SELECT current_database()")
|
(match (exec-query conn "SELECT current_database()")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue