Can not explore database created by an embedded neo4j -
i encounter strange problem.
i created database using embedded neo4j path "/users/bondwong/documents/workspace/pamela/target/data/pamela.db".
here spring configuration:
<bean id="graphdbbuilder" factory-bean="graphdbfactory" factory-method="newembeddeddatabasebuilder"> <constructor-arg value="target/data/pamela.db" /> </bean>
then changed line of neo4j-server.properties:
org.neo4j.server.database.location=/users/bondwong/documents/workspace/pamela/target/data/pamela.db
after that, used curl test system, showed good. here result of getting node id 9:
however, when fired server, , use browser see data, nothing shows up:
here location, same 1 in spring xml configuration file:
here :sysinfo result:
here junit test , result, showing insert data:
package repositorytest; import static org.junit.assert.*; import java.util.hashmap; import org.junit.test; import org.junit.runner.runwith; import org.springframework.beans.factory.annotation.autowired; import org.springframework.test.context.contextconfiguration; import org.springframework.test.context.junit4.springjunit4classrunner; import org.springframework.transaction.annotation.transactional; import com.bond.pamela.domain.diary; import com.bond.pamela.domain.factory.diaryfactory; import com.bond.pamela.persistence.dirayrepository; @runwith(springjunit4classrunner.class) @contextconfiguration({ "/applicationcontext.xml" }) public class diaryrepositorytest { @autowired dirayrepository repository; @test @transactional public void testsavediary() { diary diary = (diary) diaryfactory.getinstance().create( new hashmap<string, object>()); repository.save(diary); diary retriveddiary = repository.findone(diary.getgraphid()); assertequals(diary, retriveddiary); } }
i think should work, knows wrong? , how fix it. thx!
you can write java code server extension
or use wrappingbootstrapper time being. or rather use servercontrols neo4j-harness testing
when creating data, sure committed transaction correctly?
transaction tx = db.begintx(); // create data tx.success(); tx.close();
or better
try (transaction tx = db.begintx()) { // create data tx.success(); }
Comments
Post a Comment