Hi Jonathan,
The transaction macro automatically rolls back if it catches any Throwable, so you don't have to explicitly roll back if there's a problem as long as you don't handle any exceptions that should cause a rollback from within the transaction macro (or you throw another exception after handling an exception that should cause a rollback).
If you need to force a rollback, then you can call (rollback).
Here are some examples of transactions that will be rolled back:
(transaction
(insert :foo (values {:level 1}))
(insert :bar (values {:level 42}))
(throw (Exception.)))
(transaction
(insert :foo (values {:level 1}))
(insert :bar (values {:level 42}))
(rollback))
Let me know if you have any questions.
Thanks,
Dennis