diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e76e11..1f410ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ Only accretive/fixative changes will be made from now on. +* 1.3.next in progress + * Address [#245](https://github.com/seancorfield/next-jdbc/issues/245) by not `locking` the `Connection` when `*nested-tx*` is bound to `:ignore` -- improving `clojure.java.jdbc` compatibility. + * 1.3.862 -- 2023-03-13 * Fix [#243](https://github.com/seancorfield/next-jdbc/issues/243) by ensuring URI properties become keywords. * Fix [#242](https://github.com/seancorfield/next-jdbc/issues/242) by making the logging wrapper aware of the default options wrapper. diff --git a/src/next/jdbc/transaction.clj b/src/next/jdbc/transaction.clj index 84789ac..c927222 100644 --- a/src/next/jdbc/transaction.clj +++ b/src/next/jdbc/transaction.clj @@ -115,7 +115,12 @@ (extend-protocol p/Transactable java.sql.Connection (-transact [this body-fn opts] - (cond (or (not *active-tx*) (= :allow *nested-tx*)) + (cond + (and (not *active-tx*) (= :ignore *nested-tx*)) + ;; #245 do not lock when in c.j.j compatibility mode: + (binding [*active-tx* true] + (transact* this body-fn opts)) + (or (not *active-tx*) (= :allow *nested-tx*)) (locking this (binding [*active-tx* true] (transact* this body-fn opts)))