So now the `with-transaction` macro would look at this:

```clojure
(defmacro with-transaction
  [commit-on-success transaction & body]
  `(try
     ~@body
     (when ~commit-on-success
       (commit ~transaction))
     (catch Exception e#
       ((when-not (re-find #"Transaction failed and rolled back" (. e# getMessage))
          (rollback ~transaction))
        (throw e#)))))
```

Usage for the example given earlier:

```clojure
(let [[transaction _] (tx/begin)]
  (tx/with-transaction
    false
    transaction
    (let [[_ result] (tx/execute transaction [(tx/statement "CREATE n RETURN ID(n)")])
          new-id (-> result 
                     :data
                     first
                     row
                     first)]
      (if (< new-id 10)
        ((tx/execute transaction [(tx/statement ....)])
         (tx/commit transaction))
        (tx/rollback transaction)))))

```