If I understand it properly, this is a expected behavior in most databases. The common way for solve this, is wrapping the expected to fail code in a sub-transaction (or savepoint in database words). If that code fails, the sub-transaction will be aborted, but the main transaction will continue to be alive. With this approach you not need a complete rollback of the transaction (and no connection reset).
The main problem here is that as far as I know, clojure.java.jdbc does not has support for subtransactions. If you nest transactions, the nested transactions does nothing and everything is joined in one unique main transaction. Without aims to do spam, it there alternatives to clojure.java.jdbc that already supports sub-transactions/savepoints [1] and [2] among other transaction strategies. [1]: https://github.com/funcool/suricatta [2]: https://github.com/funcool/clojure.jdbc Andrey On Fri, Nov 13, 2015 at 8:49 AM, Andy Chambers <achambers.h...@gmail.com> wrote: > On Friday, October 30, 2015 at 5:22:40 PM UTC-7, Sean Corfield wrote: >> >> Could you provide a bit more context? >> >> We’re using clojure.java.jdbc very heavily in production and we don’t >> see any problems with exceptions. >> > > Hi Sean, > > I threw up an example repo demonstrating the type of test I'd like to be > able to write somehow. Maybe I'm just > trying to test something that should be tested in other ways. > > https://github.com/cddr/jdbc-demo > > Cheers, > Andy > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Andrey Antukh - Андрей Антух - <n...@niwi.nz> http://www.niwi.nz https://github.com/niwinz -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.