Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • 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: 22501
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • 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: 66
  • Mark post as helpful
  • send pies
  • 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: 22501
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic