Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Change from jdbc.deprecated to maintained clojure.jdbc #207
korma.db depends on deprecated version of clojure.jdbc API currently and it would be nice to depend on the maintained and non-deprecated API.
This is not merely about best practises, but has real life implications. Especially interesting is the way jdbc/transaction is handled in the deprecated version.
The deprecated version has a catch Exception for rollback/commit decisions. This leaves out other Throwables, which are not Exceptions. The non-deprecated version has fixed this transaction function properly.
What this means is that using Korma the transaction rollback/commit decision must either be handled with some custom code in the application level which is rude and difficult to do properly or be left to default behaviour inside the Java JDBC classes. The Java JDBC Connection.close() Javadoc states that "the results are implementation-defined" if the connection is closed and the transaction is still undecided. This is what happens in many Korma applications currently!
The fix should be relatively simple. Stop using the deprecated version of Clojure JDBC wrapper as they have already fixed this issue.