[orientdb] orient db disconnect/timeout

2016-05-04 Thread Mihai Ocneanu
Hello, I'm having a strange issue with orientdb getting disconnected: after a longer period of inactivity ( ~3hours ? ), when we try to insert/register a new user, the attempt hangs on commit. There is no error, but a warnings in the server log: > WARNING

[orientdb] Re: Creating each record into its own cluster

2016-03-31 Thread Mihai Ocneanu
Thank you, Scott. It didn't make any sense to me either but I wanted to have another opinion or basically know, if there was any situation where you'd want one cluster for one record [?!?] Tx, Mihai On Thursday, March 31, 2016 at 2:14:51 PM UTC+3, scott molinari wrote: > > I think of

[orientdb] Re: Creating each record into its own cluster

2016-03-30 Thread Mihai Ocneanu
Hi Alessandro, And thanks for the reply, it's helpful re: the java API. Regarding my first question, do you see any reason why you'd want each instance/record to exist in its own cluster? In your example, the each customer whould have his own cluster..? Thanks again, Mihai -- --- You

[orientdb] Creating a each record in its own cluster

2016-03-30 Thread Mihai Ocneanu
Normally, each class has its own cluster. - Would there be an incentive for each record (each instance) of that class to have its own cluster? I see none, but I gotta ask. - Also, does the Java API allow manipulations (create/delete cluster, create vertex into a specific cluster, etc) to

[orientdb] proper way to add extra information to documents (ODocument), Java API, oDB 2.1.2

2015-12-02 Thread Mihai Ocneanu
Hello, I have a vertex with some attributes and some edges, and I need to retrive it back as JSON, with the extra requirement that I also want to expand some edges. Code is something like this: OSQLSynchQuery query = new OSQLSynchQuery<>("select from ? "); List result =

[orientdb] Re: proper way to add extra information to documents (ODocument), Java API, oDB 2.1.2

2015-12-02 Thread Mihai Ocneanu
> > Hi Mihai, > > you have two solutions: > 1. use fetchplan: doc.toJson("fetchPlan:*:3") > > 2, use UNWIND: > > select *, items.* from (select *, out('E_SomeEdge') as items from ? > UNWIND items) > > Luigi Thanks for the ideas, Luigi. First method works perfectly and it does what I was

[orientdb] embedded list and contains and containsall

2015-11-26 Thread Mihai Ocneanu
Hello, I have a query that don't exactly manage to get right: A class contains a property with: type - embedded list linked type - integer. something like V_Foo { years: [2014, 2015,2016] } a { years: [2014] } b { years: [2014, 2015] } c { years: [2014, 2015, 2016] } *I wish to do a

[orientdb] updating vertex attributes and edges in the same transaction - oDB 2.1.2

2015-11-03 Thread Mihai Ocneanu
Hello, I'm wondering if it is possible (or will be possible) to update vertex properties and create/delete edges in the same transaction (Java Graph API). Right now, if I start a transaction, update some vertex properties and then say, create an edge, I get a warning in the log basically

[orientdb] DB stored functions and prepared statements - ODB 2.1.2

2015-10-28 Thread Mihai Ocneanu
Hello, I wrote a function with 2 input parameters that tries to run this query: var db = orient.getGraph(); *b = db.command("sql","select expand(sp) from (select shortestPath(?, ? , 'OUT') as sp)",[itemId, vertexId]);* When running the function, I get this error: Error on parsing script at

[orientdb] different query behavior when using Java API vs using Studio - oDB v2.1.0

2015-10-02 Thread Mihai Ocneanu
If I run the following query in studio: select from V_Comment where in('E_DocComment').@rid in [ #19:5 ] I get one result, as expected. If I run this code, using the Java API I get no results. OrientGraphFactory graphFactory = new OrientGraphFactory(SERVER_URL, USER_LOGIN, USER_PASS);

[orientdb] finding a vertex using @rid through the Java API - orientdb 2.1.2

2015-09-25 Thread Mihai Ocneanu
Hello, I'm trying to find a vertex by @rid, using the Java Graph API: Iterable vertices = txGraph.getVertices("@rid", "#12-0"); It gives no result. If I try to find a vertex using a property, the above works: Iterable vertices= txGraph.getVertices("name", "example-name"); How can I find the

[orientdb] unable to get functions through java API - OrientDB 2.1.2

2015-09-21 Thread Mihai Ocneanu
Hello, I'm trying to run a JS function from within the java API, like so: ODatabaseDocumentTx odbTx = oPartitionedDatabasePool.acquire(); OFunction function = odbTx.getMetadata().getFunctionLibrary().getFunction( "functionName"); Number result = (Number)function.execute(userId); The trouble is

[orientdb] Re: pooled connection factory for documents - oDB 2.1.2

2015-09-21 Thread Mihai Ocneanu
Thank you both for your answers. Andrey, would you say this is what you mean when you mentioned OParttionedDatabasePool? Is this the proper way? OPartitionedDatabasePoolFactory factory = new OPartitionedDatabasePoolFactory(); OPartitionedDatabasePool oPartitionedDatabasePool =

[orientdb] pooled connection factory for documents - oDB 2.1.2

2015-09-18 Thread Mihai Ocneanu
Hello, I have this simple code: ODatabaseDocumentTx db = new ODatabaseDocumentTx("SERVER_URL").open( "USER_LOGIN","USER_PASS"); List result = db.query( new OSQLSynchQuery("select * from V_User ")); ... Which works as far as the query is concerned, but, I get this error:

[orientdb] orientdb 2.1 property default value

2015-09-16 Thread Mihai Ocneanu
In the documentation, here it says we can specify default values for properties. There aren't a lot of examples, though. When I try to run create property V_Notification.isRead boolean default false it gives me :

[orientdb] (un) expected behavior of equal operator on strings

2015-09-16 Thread Mihai Ocneanu
Hello, I have this structure: Notification -> User User has .username property (string) Notification has .isRead property (boolean) Goal: select unread notifications that belong to a user If I do: select * from FF_Notification where isRead=false and out(