eduardoejp / clj-orient Goto Github PK
View Code? Open in Web Editor NEWWrapper for the OrientDB Native APIs. It supports version 1.1 of the APIs.
Wrapper for the OrientDB Native APIs. It supports version 1.1 of the APIs.
I tried running clj-orient's test suite after modifying its project.clj
to depend on OrientDB version 1.1.0
, but I ran into this issue:
problem using memory storage in 1.1.0
A quick solution was to stick this in project.clj
:
:jvm-opts ["-Dstorage.keepOpen=true"]
I wonder though if a proper fix would require a change to core.clj line #132, or a more sweeping set of revisions.
The following work fine:
(sql-query "SELECT FROM myclass
WHERE name IN [\"string1\", \"string2\"]")
(clj-query '{:from myclass
:where [(in? name ["string1" "string2"])]})
But the following variants using "args maps" are causing an exception (see below). I've tried poking around in the various ...->sql
and query-related functions, but haven't found the culprit yet. Perhaps I'm not using IN
/in?
correctly with respect to args maps?
I'm running with Clojure 1.4.0, OrientDB 1.1.0 and a clj-orient snapshot based on your master branch; and I'm connecting to OrientDB remotely instead of embedding it locally.
(sql-query "SELECT FROM myclass
WHERE name IN :names"
{:names ["string1" "string2"]})
(clj-query '{:from myclass
:where [(in? name ?names)]}
{:names ["string1" "string2"]})
Both result in:
com.orientechnologies.orient.core.sql.filter.OSQLFilterItemParameter cannot be cast to java.util.List
[Thrown class java.lang.ClassCastException]
Restarts:
0: [QUIT] Quit to the SLIME top level
Backtrace:
0: (Unknown Source) sun.reflect.NativeConstructorAccessorImpl.newInstance0
1: NativeConstructorAccessorImpl.java:39 sun.reflect.NativeConstructorAccessorImpl.newInstance
2: DelegatingConstructorAccessorImpl.java:27 sun.reflect.DelegatingConstructorAccessorImpl.newInstance
3: Constructor.java:513 java.lang.reflect.Constructor.newInstance
4: OChannelBinary.java:429 com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.createException
5: OChannelBinary.java:382 com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.handleStatus
6: OChannelBinaryAsynch.java:145 com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse
7: OChannelBinaryAsynch.java:59 com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynch.beginResponse
8: OStorageRemote.java:1556 com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse
9: OStorageRemote.java:727 com.orientechnologies.orient.client.remote.OStorageRemote.command
10: OStorageRemoteThread.java:191 com.orientechnologies.orient.client.remote.OStorageRemoteThread.command
11: OSQLQuery.java:68 com.orientechnologies.orient.core.sql.query.OSQLQuery.run
12: OSQLSynchQuery.java:78 com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.run
13: OQueryAbstract.java:30 com.orientechnologies.orient.core.query.OQueryAbstract.execute
14: ODatabaseRecordAbstract.java:380 com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.query
15: ODatabaseRecordWrapperAbstract.java:177 com.orientechnologies.orient.core.db.ODatabaseRecordWrapperAbstract.query
16: query.clj:146 clj-orient.query/sql-query
17: RestFn.java:423 clojure.lang.RestFn.invoke
18: hyper_ua.clj:1 com.projexsys.hyper-ua.data/eval6899
19: Compiler.java:6511 clojure.lang.Compiler.eval
20: Compiler.java:6477 clojure.lang.Compiler.eval
21: core.clj:2797 clojure.core/eval
22: core.clj:534 swank.core/eval5643[fn]
23: MultiFn.java:163 clojure.lang.MultiFn.invoke
24: basic.clj:55 swank.commands.basic/eval-region
25: basic.clj:45 swank.commands.basic/eval-region
26: basic.clj:79 swank.commands.basic/eval5838[fn]
27: Var.java:415 clojure.lang.Var.invoke
28: (Unknown Source) com.projexsys.hyper-ua.data/eval6897
29: Compiler.java:6511 clojure.lang.Compiler.eval
30: Compiler.java:6477 clojure.lang.Compiler.eval
31: core.clj:2797 clojure.core/eval
32: core.clj:102 swank.core/eval-in-emacs-package
33: core.clj:258 swank.core/eval-for-emacs
34: Var.java:423 clojure.lang.Var.invoke
35: AFn.java:167 clojure.lang.AFn.applyToHelper
36: Var.java:532 clojure.lang.Var.applyTo
37: core.clj:601 clojure.core/apply
38: core.clj:109 swank.core/eval-from-control
39: core.clj:114 swank.core/eval-loop
40: core.clj:343 swank.core/spawn-repl-thread[fn]
41: AFn.java:159 clojure.lang.AFn.applyToHelper
42: AFn.java:151 clojure.lang.AFn.applyTo
43: core.clj:601 clojure.core/apply
44: core.clj:340 swank.core/spawn-repl-thread[fn]
45: RestFn.java:397 clojure.lang.RestFn.invoke
46: AFn.java:24 clojure.lang.AFn.run
47: Thread.java:680 java.lang.Thread.run
Can't store embedded data like we usually present in JSON:
This:
(db/save! (db/document :user [{:foo 1}]))
or:
(db/save! (db/document :user {:foo {:bar [1]}}))
Throws an exception:
Can't serialize the object since it's not implements the OSerializableStream interface.
Every time I try to connect I get:
com.orientechnologies.common.io.OIOException: Cannot connect to any configured remote nodes: 127.0.0.1:2424
server log:
2014-01-30 16:24:55:113 INFO /127.0.0.1:37758 - Connected [OChannelBinaryServer]
2014-01-30 16:24:55:114 INFO /127.0.0.1:37758 - Writing short (2 bytes): 19 [OChannelBinaryServer]
2014-01-30 16:24:55:114 INFO /127.0.0.1:37758 - Flush [OChannelBinaryServer]
2014-01-30 16:24:55:115 INFO /127.0.0.1:37758 - Reading byte (1 byte)... [OChannelBinaryServer]
2014-01-30 16:24:55:121 INFO /127.0.0.1:37758 - Flush [OChannelBinaryServer]
2014-01-30 16:24:55:122 INFO /127.0.0.1:37758 - Closing socket... [OChannelBinaryServer]
it looks like it's getting through but then the connection gets dropped.
OrientDB version 1.6.4
Tried with both 0.5.0 and 0.6.0-SNAPSHOT
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.