I can't call server side functions (from NodeJS/OrientJs) that use the 
'orient' object on the server to access the graph database.

Does anyone have this working in 2.1.1?

I went ahead and wrote this bug but hope that I'm wrong.  
https://github.com/orientechnologies/orientdb/issues/4947

Here's an example of a server function:

var g = orient.getGraph(); 
var results = g.command("sql", "SELECT FROM OUser"); 
return results;


Here's an example of some calling code from NodeJs using OrientJs...

var OrientDB = require('orientjs');
var server = OrientDB({host: 'localhost', port: 2424, username: 'admin', 
password: 'admin'});
var db = server.use({name: 'AMIDb', username: 'admin', password: 'amsucks'
});
db.exec("SELECT testfunction()", {params: {}}) .then(function (results) { 
console.log("Results = " + JSON.stringify(results)); .......

I see these errors in the log...

2015-09-10 00:33:47:730 INFO  OrientDB Server v2.1.1 (build 
UNKNOWN@r${buildNumber}; 2015-08-31 18:08:38+0000) is active. 
[OServer]{db=TestDb} Error on unmarshal
ling record #-2:1 (java.lang.ClassCastException: 
com.tinkerpop.blueprints.impls.orient.OrientVertex cannot be cast to 
com.orientechnologies.orient.core.record.O
Record)
java.lang.ClassCastException: 
com.tinkerpop.blueprints.impls.orient.OrientVertex cannot be cast to 
com.orientechnologies.orient.core.record.ORecord
        at 
com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerStringAbstract.fieldTypeToString(ORecordSerializerStringAbs
tract.java:197)
        at 
com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerCSVAbstract.embeddedCollectionToStream(ORecordSerializerCSV
Abstract.java:843)
        at 
com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerCSVAbstract.fieldToStream(ORecordSerializerCSVAbstract.java
:534)
        at 
com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerSchemaAware2CSV.toString(ORecordSerializerSchemaAware2CSV.j
ava:506)
        at 
com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerStringAbstract.toStream(ORecordSerializerStringAbstract.jav
a:689)
        at 
com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerSchemaAware2CSV.toStream(ORecordSerializerSchemaAware2CSV.j
ava:268)
        at 
com.orientechnologies.orient.core.record.impl.ODocument.toStream(ODocument.java:2282)
        at 
com.orientechnologies.orient.core.record.impl.ODocument.toStream(ODocument.java:671)
        at 
com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.getRecordBytes(OBinaryNetworkProtocolAbstract.java:424)
        at 
com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.writeRecord(OBinaryNetworkProtocolAbstract.java:443)
        at 
com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.writeIdentifiable(OBinaryNetworkProtocolAbstract.java:141)
        at 
com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.serializeValue(ONetworkProtocolBinary.java:1389)
        at 
com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.command(ONetworkProtocolBinary.java:1337)
        at 
com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:396)
        at 
com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:223)
        at 
com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)

2015-09-10 00:34:14:152 WARNI {db=TestDb} Cannot serialize record: 
#-2:1{testfunction:[4]} v0 [ONetworkProtocolBinary]


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to