Skip to content

Commit

Permalink
updates to neo4j-java-driver v1.5.0. Improves transaction support
Browse files Browse the repository at this point in the history
  • Loading branch information
tuddman committed Jan 17, 2018
1 parent 4e843ed commit 8be7837
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
:url "http://clojureneo4j.info"
:license {:name "Eclipse Public License"}
:min-lein-version "2.5.1"
:dependencies [[org.clojure/clojure "1.9.0-beta1"]
:dependencies [[org.clojure/clojure "1.9.0"]
[cheshire "5.8.0"]
[clj-http "3.7.0" :exclusions [org.clojure/clojure]]
[clojurewerkz/support "1.1.0" :exclusions [com.google.guava/guava]]
[org.neo4j.driver/neo4j-java-driver "1.4.4"]]
[com.taoensso/timbre "4.10.0"]
[org.neo4j.driver/neo4j-java-driver "1.5.0"]]

:test-selectors {:default (fn [m] (and (not (:time-consuming m))
(not (:http-auth m))
Expand Down
10 changes: 8 additions & 2 deletions src/clojure/clojurewerkz/neocons/bolt.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
;; You must not remove this notice, or any other, from this software.

(ns clojurewerkz.neocons.bolt
(:require [clojure.string :as string])
(:require [clojure.string :as string]
[taoensso.timbre :as log])
(:import (java.util Map)
(org.neo4j.driver.v1 AuthTokens Config Driver
GraphDatabase Record Session
StatementResult StatementRunner
Transaction Values)))
Transaction TransactionWork Values)))

(defn- env-var
[^String s]
Expand Down Expand Up @@ -49,6 +50,11 @@
^Transaction [^Session session]
(.beginTransaction session))

(defn run-tx
[^Transaction transaction ^String qry ^Map params]
(map (fn [^Record r] (into {} (.asMap r)))
(iterator-seq (.run transaction qry params))))

(defn tx-successful
[^Transaction transaction]
(.success transaction))
Expand Down

0 comments on commit 8be7837

Please sign in to comment.