Closed seancorfield closed 2 years ago
Although I've closed out two more general tickets around wrapped connections, I'm going to keep this one open as a narrower problem that might be worth solving at some point.
After a lot of consideration and experimentation over the last month, I've concluded that this isn't realistic, given the contracts already in place:
get-datasource
and get-connection
specifically return DataSource
and Connection
respectively -- Java types, not Clojure protocols,with-transaction
specifically invokes the body with the symbol bound to a Connection
-- again, a Java type, not a Clojure protocol,DataSource
or Connection
-- automatically rewrapping such things breaks the existing contract (of working with Java objects).
Can we provide an alternative to
with-transaction
that detects and does the rewrapping automatically on the bound TX?