Strange Issue with jo4neo

18 views
Skip to first unread message

Pascal Salg

unread,
Jul 25, 2013, 4:48:44 PM7/25/13
to jo4...@googlegroups.com
Hey y'all,

I'm having a little trouble with jo4neo... not sure where to post this so I'll just use this group..
(using the current version 0.4.1)

Consider the following setup (this is a simplistic view just enough to demonstrate where the problem lies)

public class rootnode {
@neo
private Collection<childnode> childnodes;
//getters and setters ...
}

public class childnode {
@neo
private String name;
@neo
private Collection<otherchildnode> otherchildren;
// getters and setters ...
}

public class otherchildnode {
@neo
private String name;
// getters and setters
}

Now what I'm trying to do is to remove an otherchildnode from a childnode element.
Sounds simple right?
 
Just do something like this:
childnode.getOtherchildren.remove('specific otherchildnode');
objectGraph.persist('specific otherchildnode we just removed the element from')

Let's assume for this exercise that the otherchildnode we just changed started out with 2 child elements and we removed one of them.

Now I again fetch the root node from the objectgraph

rootnode = objectGraph.get(rootnode.class).iterator().next();

Then I do an Assert on the size of the specific otherchildnode we just changed..
Assert.assertEquals(1, rootnode.getChildnodes().getOtherchildren().size());

And this is where it fails.. the size of the getOtherchildren Collection actually is 2 instead of 1 ...


Is it possible that I'm receiving an old / not updated version of the dashboard when again fetching it from the objectgraph ?
(I think remembering that jo4neo does some caching..)

Is this a bug or a mistake on my part on using the objectgraph ?

Been pulling my hairs out on this one, hope someone can help =)

Greetings from Germany,

p.s.

Peter Neubauer

unread,
Jul 26, 2013, 8:58:21 AM7/26/13
to jo4neo
Pascal,
if you want Object-Graph-Mapping, I would try Spring Data Neo4j, which is much more capable and updated, see http://www.springsource.org/spring-data/neo4j. Otherwise, I think you should update Jo4Neo to a later neo4j version and paste an example project on github, so we easily can take a look?

/peter


Cheers,

/peter neubauer

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

Kids in Malmö this summer?        - http://www.kidscraft.se
Neo4j questions? Use GraphGist. - http://gist.neo4j.org


--
You received this message because you are subscribed to the Google Groups "jo4neo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jo4neo+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Pascal Salg

unread,
Jul 28, 2013, 5:29:35 PM7/28/13
to jo4...@googlegroups.com, peter.n...@neotechnology.com
Hi peter,

never mind my first post, got it fixed (was an error on my side..)

Though I recently started thinking about updating the jo4neo code to accommodate for changes made to the neo4j apis in the recent versions (specifically the latest stable version 1.9.2)

I tested with neo4j 1.9.2 and it still works, although some neo4j apis have been deprecated.

I'm aware of the spring data neo4j project but never got around to use it.
'Beauty in Simplicity' is what I always propagate and the spring ogm (and the hibernate ogm as well for that matter) seem a little .. well.. too big for this motto ;)
That's why I prefer jo4neo, it fits my needs perfectly and everything missing I can add myself.

I'll check out the spring data neo4j project in some time in the future though.
I guess I need to be a little familiar with concepts of spring? Until now I stuck with Weld for doing Dependency Injection and similar stuff.. (My application server of choice is jboss 7)

As for an example project, that's a little problematic as this is a work-related project and sharing code from there is a little critical ;) But as I said, I got it fixed, it was an error on my part.

In any case, thanks for your reply peter,


Greetings from Germany,

p.s.

Peter Neubauer

unread,
Jul 29, 2013, 2:40:01 AM7/29/13
to jo4neo

Pascal,
No problem, you are welcome!

Reply all
Reply to author
Forward
0 new messages