Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-21-2020 07:04 AM
Hi,
I have updated my database to version 4.0.0, and I need to use it embedded, in Java. I updated the code so that I use the DatabaseManagementServiceBuilder. The directory I give to the builder constructor is the NEO4J_HOME, and when I create the GraphDatabaseService object, I provide the name of the database, as it appears in NEO4J_HOME/data/databases. However I get the error of not found database. I tried starting the database first by calling the startDatabase method, but that returns an error of "unsupported administration command: START DATABASE". I can't find online any embedded database example that does not delete the content of the dbms first and start with the population of an empty database.
Am I missing something? Is this the expected behavior? Of course, I can provide more details from logs and the java code if needed.
Thanks a lot,
Ioana
Solved! Go to Solution.
02-21-2020 07:32 AM
Multi-Database is a enterprise-only feature. I guess you do not have the respective enterprise jars on your classpath so startDatabase
barks.
Not 100% sure, but in community the default database should be automatically started and you can get a reference to it via https://neo4j.com/docs/java-reference/4.0/javadocs/org/neo4j/dbms/api/DatabaseManagementService.html...
02-21-2020 07:32 AM
Multi-Database is a enterprise-only feature. I guess you do not have the respective enterprise jars on your classpath so startDatabase
barks.
Not 100% sure, but in community the default database should be automatically started and you can get a reference to it via https://neo4j.com/docs/java-reference/4.0/javadocs/org/neo4j/dbms/api/DatabaseManagementService.html...
02-21-2020 08:13 AM
Yes, I am using community edition.
Oh dear. So, indeed, calling setConfig(GraphDatabaseSettings.default_database, "nameofdb") and then creating GraphDatabaseService db = managementService.database("nameofdb"), started the database and now I can work with it.
I thought that providing the path to the NEO4J_HOME would ensure that the system uses the config file (where the default was set to the correct db) but seems like all settings must be set explicitly when building the DatabaseManagementService. But the fact that no other database can be accessed than the default, is a bit unexpected.
Thanks a lot for the quick and correct answer:)
-Ioana
02-22-2020 02:55 AM
.. and thanks for validating my theory 😉
All the sessions of the conference are now available online