Re: [Neo4j] Rest API issue

90 views
Skip to first unread message

Peter Neubauer

unread,
Sep 11, 2012, 2:50:15 AM9/11/12
to ne...@googlegroups.com
Sudhakar,
first, the impl over REST sounds a bit expensive roundtrip-wise.
Secondly, could you extract a simple test that gets this problem? I
think it might be that since you are using the iterator index hits,
the second time, it is already empty?

Cheers,

/peter neubauer

Neo4j 1.8.RC1 "Vindeln Vy" -
http://blog.neo4j.org/2012/09/neo4j-18rc1-really-careful-ftw.html

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Wanna learn something new? Come to @graphconnect.


On Tue, Sep 11, 2012 at 7:53 AM, Sudhakar G <sudhak...@gmail.com> wrote:
> Hi,,
>
> I am using blueprints 1.2 over Java REST API for Neo4J.
> I have an usecase where I need to retrieve the same vertex from Neo4J twice
> in a single transaction.
>
> First call is working perfectly fine where as the second call is failing
> with the below exception.
>
> java.lang.NullPointerException
>
> at
> org.neo4j.rest.graphdb.index.SimpleIndexHits.hasNext(SimpleIndexHits.java:80)
>
> at
> com.tinkerpop.blueprints.pgm.impls.neo4j.util.Neo4jVertexSequence.hasNext(Neo4jVertexSequence.java:35)
>
> at
> com.pg.social.dao.graphdb.IteratorUtil.getSingle(IteratorUtil.java:18)
>
> at
> com.pg.social.dao.graphdb.service.profile.SocialProfileManager.getSocialVertex(SocialProfileManager.java:273)
>
> at
> com.pg.social.dao.graphdb.service.network.NetworkProfileManager.importNetworkProfile(NetworkProfileManager.java:234)
>
>
> Can someone let me know why and when this error comes....
>
> Thanks in advance.
>
>
> --
>
>

Sudhakar G

unread,
Sep 11, 2012, 4:22:35 AM9/11/12
to ne...@googlegroups.com
Hi Peter,

We are fine with the round trip delay as we have multiple services connecting to the same Neo4j node and communicating through REST API is the only way in which that can be done(Correct me if am wrong).

Secondly, the same vertex is being queried multiple times.
So the result should be consistent across all the calls.
Here is my sample code.

Index<Vertex> sampleIndex= indexableGraph.getIndex(
indexName, Vertex.class);


Vertex sampleVertex= IteratorUtil.getSingle(sampleIndex.get(
index, indexValue)
.iterator());


The same is being called multiple times in a single transaction with the same value.
For first call, everything is fine.
But for the second call, the below exception is coming......

Michael Hunger

unread,
Sep 11, 2012, 7:23:44 AM9/11/12
to ne...@googlegroups.com
Which versions are you using? (neo4j, batch-rest-api)

Do you use batching or tx boundaries (in the newer versions of the java-rest-binding?)

If so, your requests are batched and only be available after tx.finish() / end of batch callback, to go back to the non-batching tx you should set the system property.

org.neo4j.rest.batch_transactions=false

Michael

Sudhakar G

unread,
Sep 11, 2012, 1:10:48 PM9/11/12
to ne...@googlegroups.com
Hi Peter,

I am using Blueprints 1.2 over Neo4J database running on 1.8M06.
The rest API Impl version is blueprints-neo4j-graph-1.2.

The problems that I am facing is that sometimes I am able to read vertex/node from a previously completed transaction and sometimes I am not able to read the same vertex/node with the same node id.

I am running my application with the property org.neo4j.rest.batch_transactions set to true.

Also I would like to know if the latest blueprints-neo4j-graph that runs over blueprints 2.0 

Thanks,
Sudhakar Gurram


On Tuesday, September 11, 2012 12:20:37 PM UTC+5:30, Peter Neubauer wrote:

Peter Neubauer

unread,
Sep 12, 2012, 5:05:56 AM9/12/12
to ne...@googlegroups.com
Mmh,
can you recreate the test in some way that you can share? Would love
to debug it. I am working on the upgrade to Blueprints 2.1, hope to
get it into master soonish.

Cheers,

/peter neubauer

Neo4j 1.8.RC1 "Vindeln Vy" -
http://blog.neo4j.org/2012/09/neo4j-18rc1-really-careful-ftw.html

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

Wanna learn something new? Come to @graphconnect.


> --
>
>

Sudhakar Gurram

unread,
Sep 12, 2012, 5:36:41 AM9/12/12
to ne...@googlegroups.com
Hi Peter,

Could you please let me know when the upgradation to Blueprints 2.1 will be commited.
If the ETA is within our project deadlines, we will wait for the upgraded version.

Meanwhile, I will send the modified testcase.

Thanks And Regards,
Sudhakar Gurram

--



Sudhakar G

unread,
Sep 13, 2012, 9:51:12 AM9/13/12
to ne...@googlegroups.com
Hi Peter,

Just came to know that this issue is coming when the same node index is queried before the previous iterator is closed.
Can you check from that angle and let us know if that is the actual issue.

Also, can you let us know when the REST API impl over blueprints 2.1 would be committed.

Thanks in Advance..


On Tuesday, September 11, 2012 12:20:37 PM UTC+5:30, Peter Neubauer wrote:

Peter Neubauer

unread,
Sep 13, 2012, 9:59:46 AM9/13/12
to ne...@googlegroups.com

Hi there,
The pull requests for the upgrade are now on pulls.neo4j.org, hope to get it in soon.

/peter

Send from mobile device.

--
 
 
Reply all
Reply to author
Forward
0 new messages