seancorfield / next-jdbc

A modern low-level Clojure wrapper for JDBC-based access to databases.
https://cljdoc.org/d/com.github.seancorfield/next.jdbc/
Eclipse Public License 1.0
760 stars 90 forks source link

Malformed member expression when using .setSavePoint #146

Closed tkriik closed 3 years ago

tkriik commented 3 years ago

Describe the bug

Hi,

I get the following error:

Caused by: java.lang.IllegalArgumentException: Malformed member expression, expecting (.member target ...)

...when using (.setSavePoint) inside a (jdbc/with-transaction [tx my-datasource] ...) block.

Using (.setSavePoint tx) does not work, as the HikariDataSource does not support such a method.

project.clj/deps.edn

[org.clojure/clojure "1.10.0"]
[com.zaxxer/HikariCP "3.4.5"]
[org.postgresql/postgresql "42.2.12"]
[seancorfield/next.jdbc "1.0.445"]
seancorfield commented 3 years ago

You have a typo in your code: it's .setSavepoint, not .setSavePoint.

Just to be sure it all works as expected, I just added save point tests for both HikariCP and c3p0: https://github.com/seancorfield/next-jdbc/blob/develop/test/next/jdbc_test.clj#L318