To add to this, (all-nodes) silently populates an empty list (probably
not what the user wants).

user=> (neo/with-db! "playground" (neo/all-nodes))
()
user=> (neo/with-db! "playground" (doall (neo/all-nodes)))
(#<NodeProxy Node[0]> #<NodeProxy Node[1]> #<NodeProxy Node[2]>
#<NodeProxy Node[3]> #<NodeProxy Node[4]> #<NodeProxy Node[5]>
#<NodeProxy Node[6]> #<NodeProxy Node[7]> #<NodeProxy Node[8]>)


The major problem, of course, is that we can only be lazy inside the
with-db! macro....



On Oct 4, 8:34 pm, Daniel <[email protected]> wrote:
> Borneo get's bit by this bug:
>
> http://lists.neo4j.org/pipermail/user/2011-February/006460.html
>
> Here's a simple example:
>
> (neo/with-db! "playground"
>         (let [humans (neo/walk (neo/root) :humans)
>               human-nodes (neo/traverse humans :human)]
>           (map neo/props human-nodes)))
> NullPointerException
> org.neo4j.kernel.impl.nioneo.xa.ReadTransaction.nodeLoadLight
> (ReadTransaction.java:81)
> (
>
> Given the bug's nature, we can easily fix the Exception by wrapping
> the last function call in a doall...
>
> (neo/with-db! "playground"
>         (let [humans (neo/walk (neo/root) :humans)
>               human-nodes (neo/traverse humans :human)]
>           (doall (map neo/props human-nodes))))
> ({:name "Cypher"} {:name "Morpheus", :rank "Captain", :age 35} {:name
> "Trinity", :age 27} {:name "Thomas Anderson", :age 29})
>
> This could be easily fixed in borneo.core by wrapping the last
> function call, or just documenting it & leaving it to the programmer.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to