• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is Embedded Neo4J still a valid approach to access Neo4J within Java

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am fairly new to the concept of Graph Databases and I have recently looked into Neo4J together with a way of systematically adding/deleting data in Java. According to http://neo4j.com/docs/stable/tutorials-java-embedded.html, I can use Neo4J in Embedded Java applications. Although not probably the best tutorial around, I have followed this: http://www.tutorialspoint.com/neo4j/neo4j_native_java_api_example.htm and soon noticed that is deprecated and from http://neo4j.com/docs/stable/javadocs/org/neo4j/graphdb/factory/GraphDatabaseFactory.html it is recommended to use newEmbeddedDatabase(File) instead. I have also noticed many other deprecated methods. My ultimate goal is to insert and modify nodes, labels and relationships directly from Java into my localhost instance of Neo4J, is embedded Java still a viable option?

Thanks,

Ilaria
 
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not only is embedded Neo4J still valid, I have an app that uses it. The difference is in how you set it up and configure it.

The biggest problem I've found with Neo4J, in fact is that some major architectural components have gone through significant redesigns and revisions. This has resulted in documentation that is often out-of-date* and/or incomplete. I'm hoping that things are more stable and complete now, but it has been a few months since I checked.

===
* One of the axioms of the Internet is that a search for documentation will return the obsolete stuff ahead of the current stuff. That's why I encourage people to put datestamps on their manuals, blogs, and other how-to web pages.
 
Geane Norm
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Tim, much appreciated. Do you have anything other than the technical documentation from Neo4J that it can of any help to configure the access to Neo4J 2.3.2. As mentioned, my Neo4J is running locally on my locahost and I am using .newEmbeddedDatabase(File), as follows:



It is currently point to the directory where my Neo4J defaultDB resides, is that correct?

Thank you,



 
Tim Holloway
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I use the Spring Framework for my persistency systems, so I configure using Spring Beans. That's one reason why Neo4J has been a problem for me, since it's as much about changes to the Spring stuff as it is about the actual Neo4J stuff.

My Spring config looks like this, though:


The comments around the "annotation-driven" stanza have to do with the fact that transaction annotations weren't working reliabily last time I touched the code so the actual program is presently manually managing transactions.

Note that I'm using JNDI to point to the database directory. That permits configuring it when I deploy the webapp instead of hard-coding it into the program.
 
reply
    Bookmark Topic Watch Topic
  • New Topic