Re: [orientdb] Orient DB for graph db gets stuck at iterator

129 views
Skip to first unread message

Luca Garulli

unread,
Apr 24, 2013, 10:11:27 AM4/24/13
to orient-database
Hi,
without a test case can you debug what happens inside hasNext() ?

Lvc@


On 24 April 2013 09:42, deepa ganu <deep...@gmail.com> wrote:
I have a graph db , named adtran when i try to search a vertex using this , initially there would be no vertex with propert "peer_slot" , if i get the hasNext() as false then i want to create a vertex , else use the existing vertex 
private  OrientGraph graph = new OrientGraph("remote:localhost/Adtran", "admin", "admin");
 Iterable<Vertex> it = graph.getVertices("peer_slot", etos.getSlotNumber());
Iterator<Vertex> iter = it.iterator();
if(iter.hasNext())
{
v = iter.next();
}

It stucks at hasNext() and does not come out , i have to suspend the thread . What do you think might be the reason .

--
 
---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Shishya

unread,
Feb 19, 2014, 4:24:04 AM2/19/14
to orient-...@googlegroups.com
Luca, is there a iterator for Javascript function.

I have to process all the documents stored in a class. So I need a handle to gotNext() after processing each record.
Please advice.

Thanks

Luca Garulli

unread,
Feb 19, 2014, 6:16:30 AM2/19/14
to orient-database
What do you mean? Inside JS function?

Lvc@

prabhat

unread,
Feb 19, 2014, 10:41:36 AM2/19/14
to orient-...@googlegroups.com
I need to iterate through all vertices which are just a key:value pairs, to extract data and info from them.
One option could be incrementing the RIDs from 0 to count(), but that is not an elegant solution. So if some object which can iterate over records of class is available, that can be really good solution for many such scenarios





--
 
---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/PTA6QfRjuX4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

Luca Garulli

unread,
Feb 19, 2014, 11:05:10 AM2/19/14
to orient-database
Hi,
you can execute a query, like:

for( OrientVertex v : graph.command( new OCommandSQL("select from V") ).execute() ){
  ...
}


Lvc@

prabhat

unread,
Feb 20, 2014, 1:29:22 AM2/20/14
to orient-...@googlegroups.com
I get this error for javascript part of code

!Unrecognized command: 'for( OrientVertex v : graph.command( new OCommandSQL("select from mynodes") ).execute() ){'

-------My code is----------
 connect remote:localhost/database root pass123
for( OrientVertex v : graph.command( new OCommandSQL("select from mynode") ).execute() ){

  print v;
}
--------------------------
Regards

Luca Garulli

unread,
Feb 20, 2014, 4:20:27 AM2/20/14
to orient-database
Hi,
In Javascript the syntax of for is different. Try this:

var result = graph.command( new OCommandSQL("select from mynode") ).execute().iterator():
while( result.hasNext() ){
  var v = result.next();
  print v;
}

Lvc@

prabhat

unread,
Feb 20, 2014, 5:16:38 AM2/20/14
to orient-...@googlegroups.com
I get this heap space error. mynode has 5 million records

Error: com.orientechnologies.orient.enterprise.channel.binary.OResponseProcessingException: Exception during response processing.
Error: java.lang.OutOfMemoryError: Java heap space

I have tuned the server this way
 -d64 -Xms512m -Xmx2g -Dfile.mmap.maxMemory=3.2gb  

Any pointers on tuning plz

Regards


Prabhat Kumar Singh

prabhat

unread,
Feb 20, 2014, 5:29:47 AM2/20/14
to orient-...@googlegroups.com
Also, execute() iterator() hasNext() are not defined, as I some more errors.

Regards

Luca Garulli

unread,
Feb 20, 2014, 5:48:05 AM2/20/14
to orient-database
Hi,
sorry, JS has a simplified API. Try this:

var result = graph.command( "select from mynode" );
for( v in result ){
  print v;
}
Reply all
Reply to author
Forward
0 new messages