Re: [Neo4j] .Net Exception

70 views
Skip to first unread message

Michael Hunger

unread,
Sep 12, 2012, 11:23:52 AM9/12/12
to ne...@googlegroups.com
Please supply more context:

used version neo4j-server
used driver and version
your domain model
how were you retrieving the nodes
full exceptions traces from data/log data/graph.db/messages.log

Otherwise we cannot help you.


Am 12.09.2012 um 18:21 schrieb Han:

> Hi all,
>
> i am very new to Neo4j. i created a c# program and stored about 300000 nodes. when trying to retrieve all nodes, i get an AggregateException. Any idea?
>
> Thanks
>
> --
>
>

Han

unread,
Sep 12, 2012, 11:48:14 AM9/12/12
to ne...@googlegroups.com
Hi,
Thank you for your reply.


On Wednesday, September 12, 2012 11:23:59 PM UTC+8, Michael Hunger wrote:
Please supply more context:

used version neo4j-server
Neo 1.8.RC1
used driver and version
installed Neo4jclient from Nuget (i guess the latest) version v4.0.30319
your domain model

 
how were you retrieving the nodes
//var cities = Client.Cypher
            //    .Start("r", Client.RootNode)
            //    .Match("r<-[:IS_MEMBER]-z-[:HAS_VISITED]->c")
            //    .Return((z, c) => new MyProjection
            //    {
            //        CityName = c.As<City>().CityName,
            //        PersonName = z.As<Person>().Name
            //    });
            //foreach (var result in cities.Results)
            //{
            //    listBox1.Items.Add(result.PersonName + " has visited " + result.CityName);
            //} 
full exceptions traces from data/log data/graph.db/messages.log
Sep 12, 2012 11:00:51 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
at java.lang.AbstractStringBuilder.append(Unknown Source)
at java.lang.StringBuffer.append(Unknown Source)
at java.io.StringWriter.write(Unknown Source)
at org.codehaus.jackson.impl.WriterBasedGenerator._flushBuffer(WriterBasedGenerator.java:1812)
at org.codehaus.jackson.impl.WriterBasedGenerator.writeString(WriterBasedGenerator.java:451)
at org.codehaus.jackson.map.ser.std.StringSerializer.serialize(StringSerializer.java:28)
at org.codehaus.jackson.map.ser.std.StringSerializer.serialize(StringSerializer.java:18)
at org.codehaus.jackson.map.ser.std.MapSerializer.serializeFields(MapSerializer.java:262)
at org.codehaus.jackson.map.ser.std.MapSerializer.serialize(MapSerializer.java:186)
at org.codehaus.jackson.map.ser.std.MapSerializer.serialize(MapSerializer.java:23)
at org.codehaus.jackson.map.ser.std.StdContainerSerializers$IndexedListSerializer.serializeContents(StdContainerSerializers.java:122)
at org.codehaus.jackson.map.ser.std.StdContainerSerializers$IndexedListSerializer.serializeContents(StdContainerSerializers.java:71)
at org.codehaus.jackson.map.ser.std.AsArraySerializerBase.serialize(AsArraySerializerBase.java:86)
at org.codehaus.jackson.map.ser.StdSerializerProvider._serializeValue(StdSerializerProvider.java:610)
at org.codehaus.jackson.map.ser.StdSerializerProvider.serializeValue(StdSerializerProvider.java:256)
at org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1613)
at org.neo4j.server.rest.domain.JsonHelper.createJsonFrom(JsonHelper.java:102)
at org.neo4j.server.rest.repr.formats.JsonFormat.complete(JsonFormat.java:56)
at org.neo4j.server.rest.repr.ListRepresentation.serialize(ListRepresentation.java:53)
at org.neo4j.server.rest.repr.OutputFormat.format(OutputFormat.java:170)
at org.neo4j.server.rest.repr.OutputFormat.formatRepresentation(OutputFormat.java:120)
at org.neo4j.server.rest.repr.OutputFormat.response(OutputFormat.java:107)
at org.neo4j.server.rest.repr.OutputFormat.ok(OutputFormat.java:55)
at org.neo4j.server.rest.web.RestfulGraphDatabase.getNodeRelationships(RestfulGraphDatabase.java:462)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
 
Otherwise we cannot help you.

i hope this has nothing to do with memory. i have been using Document-Oriented with 250000 documents and complex objects but didn't hit out of memory issue. the main reason why i would like to use graphs is the performance and few other restrictions within document-oriented servers such as paging. My use case mandates that i fetch large amount of data for reporting purposes.

Regards
Han

Michael Hunger

unread,
Sep 12, 2012, 1:05:59 PM9/12/12
to Neo4j, Tatham Oddie, Romiko Derbynew
Ah, thanks

it actually has to do with memory :)
The result is built up in the neo4j server and takes too much memory, we added streaming in Neo4j 1.8.M06 but I don't know if the neo4jclient already supports that.

a header of X-Stream:true will not keep the stuff in memory but will stream it out to your client as soon as possible.

Adding Tatham & Romiko the Authors of Neo4jClient

Cheers

Michael

--
 
 

amjad hanesh

unread,
Sep 12, 2012, 1:10:52 PM9/12/12
to ne...@googlegroups.com
Great stuff!

i hope the guys included streaming into the library. if not, hope they will in the future.

ok. now how do i go about this, as i cannot see a way to implement paging unless, of course, i do some workaround at the client?

many thanks again

--
 
 

Michael Hunger

unread,
Sep 12, 2012, 1:20:46 PM9/12/12
to ne...@googlegroups.com
You can use skip and limit for paging.

Michael

--
 
 

amjad hanesh

unread,
Sep 12, 2012, 1:26:31 PM9/12/12
to ne...@googlegroups.com
thank you

--
 
 

Michael Hunger

unread,
Sep 12, 2012, 1:31:02 PM9/12/12
to ne...@googlegroups.com
You might also raise an issue here, if it is not covered in their docs: https://bitbucket.org/Readify/neo4jclient/issues?status=new&status=open

--
 
 

amjad hanesh

unread,
Sep 12, 2012, 1:39:11 PM9/12/12
to ne...@googlegroups.com
ya, i think that would be one good place to follow up on other issued faced.

we are planning to migrate all our current and future applications backend to Neo4j. So the technical resources, support, functionality of the database all contribute to our final decision. We find that in the case of document-oriented, we focus more on the implementation around what the server won't complain about rather than our use cases. Many times we had to structure our data model to actually suite the server and learning how it behaves rather than channelling our energy into solving the actual business problem. Graph db is rather flexi, but Java based and we work mostly on .Net platform. 

Anyhow, i am hoping for the best here as to stick to Neo4j for our future products.

Regards
Han

--
 
 

Michael Hunger

unread,
Sep 12, 2012, 2:38:29 PM9/12/12
to ne...@googlegroups.com
Han,

the company which develops Neo4jClient - Readify is an official partner of Neo Technology. 

So you can get all the support and consulting that you need from them.


Cheers

Michael

--
 
 

Michael Hunger

unread,
Sep 12, 2012, 2:39:14 PM9/12/12
to ne...@googlegroups.com
Many other databases are also written in other languages (c, cpp, erlang etc.) so the implementation language of the database shouldn't be a issue.

Michael

--
 
 

aha...@gmail.com

unread,
Sep 12, 2012, 9:28:29 PM9/12/12
to ne...@googlegroups.com
Hi Michael,
Thanks for the comments and reference to Neo4jclient.

Actually what I meant by implementation language is the fact that thus far only went production with .Net apps. Migrating to Java might not be in our near future plans.

Thanks again

Regards
Amjad
Sent by Maxis from my BlackBerry® smartphone

From: Michael Hunger <michael...@neotechnology.com>
Date: Wed, 12 Sep 2012 21:39:14 +0300
Subject: Re: [Neo4j] .Net Exception

--
 
 
Reply all
Reply to author
Forward
0 new messages