spring-data-neo4j

Index creation error when starting embedded Neo4j HA Slave

烂漫一生 提交于 2019-12-10 21:31:41
问题 I am trying to create a cluster of Java applications running the embedded Neo4J HA server but I am getting an error when starting any slave servers Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement CREATE INDEX ON :`DeviceNode`(`deviceType`); nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement CREATE INDEX ON :`DeviceNode`(`deviceType`); nested exception is org.neo4j.cypher

How to manually manage Neo4j locks in Spring managed transaction

好久不见. 提交于 2019-12-10 21:24:41
问题 First of all I will explain why I would like to manually set write locks. I use Neo4j database in my web service application based on Spring Data Neo4j. Transactions are managed by Spring, I just use @Transactional annotation. However, I have problem with specific use case which leads to database inconsistency. I have a method that is transactional and its aim is to make such nodes/relation in database: (p:Person)-[:USES]->(s:SIM_Card{phoneNumber:"xxx"}) Its algorithm is as follows: -check if

“No property found for type” combining repositories spring-data-neo4j

霸气de小男生 提交于 2019-12-10 21:17:23
问题 I'm using spring-data-neo4j and I'm trying to combine repositories to be able to use custom ones. I think I've followed correctly the nomenclature conventions specified in 20.8.7 Creating repositories and other SO questions like this. Anyway, I'm doing something wrong because I'm getting this exception message Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property someCriteria found for type User! User entity @NodeEntity

How to use Create Unique with Cypher

时间秒杀一切 提交于 2019-12-10 12:06:22
问题 My target is to create node + set new property to it in case not exists if it's exist I just want to update it's property Tried this: MATCH (user:C9 {userId:'44'}) CREATE UNIQUE (user{timestamp:'1111'}) RETURN user *in case the node with the property userId=44 already existed I just want to set it's property into 1111 else just create it and set it. error I am getting: user already declared (line 2, column 16 (offset: 46)) "CREATE UNIQUE (user{timestamp:'1111'})" should I switch to Merge or?

spring-data-neo4j basic one-to-many relationship not persisting

被刻印的时光 ゝ 提交于 2019-12-10 06:28:28
问题 EDIT : Sample project available on github. I'm using Neo4J (Rest graph database, hosted in grapheneDb) and Spring Data in our backend project. <bean id="graphDatabaseService" class="org.springframework.data.neo4j.rest.SpringCypherRestGraphDatabase"> I have a simple one-to-many relationship between two entities: User and Stay . EDIT : I thought this wasn't relevant for the issue, but after seeing a similar problem in SDN4, I think I need to update the question (there is a basic @NodeEntity

How to generate Index and Constraint script for Neo4j store using Liquigraph in java?

只愿长相守 提交于 2019-12-09 18:33:53
问题 I am trying to generate the Index and Constraint for my spring entities. I am not using any capability of spring-data to do it such as indexes.auto=assert . How can I generate the scripts with following conditions I need to generate scripts in offline mode. ie I cannot provide any Neo4j server,user,password etc. I need to use the java api to achieve it. I am able to create liquigraph change-log but I can't find a way to generate the script. The maven dependency I have used is <!-- https:/

Load an object in Neo4j OGM 1.1.3 ogm depth of 2 very slow

柔情痞子 提交于 2019-12-08 21:57:28
问题 I get a timeout while querying for depth 2 using session.load() .I'm working with Neo4j OGM 1.1.3 (Attempting to migrate from Spring Data Neo4j 3.4). Trying to load a Node object class Node { Long id; String name; @Relationship(type="NodeToCategory") Category category; @Realtionship(type="NodeToChildNode") Node node } class Category { Long id; String name; String color; Date createdAt; } The category that is connected to my node is very popular (20,000 nodes have the same category) and when I

Neo4J REST performance

烂漫一生 提交于 2019-12-08 09:33:45
问题 I've built a Java application that uses Spring and Neo4J in REST mode. The Neo4j is installed on Linux Red Hat machine and I changed nothing in its default configuration. Queries / inserts run VERY slow when I use my Java Services to query data, but the same queries run fast when I do the same operations through the remote web admin. for example, I have a query that runs in few milliseconds when I run it from the web admin, but it takes more than 30 seconds (!!) to return when calling it from

Syntax error on running Cypher Query with dynamic node label

Deadly 提交于 2019-12-08 09:25:45
问题 Hello i'm trying to get data by a dynamic Cypher query.. However got an exception like: org.neo4j.rest.graphdb.query.CypherTransactionExecutionException: Error executing cypher statements [{code=Neo.ClientError.Statement.InvalidSyntax, message=Invalid input '{': expected whitespace or a label name (line 1, column 54) "MATCH (parentNode:ParentEntity)-[:HAS_A]->(childNode:{dynamicChildEntityType})= WHERE id(parentNode)={parentNodeId} RETURN childNode order by childNode.orderNr" ^}] while trying

unable to create more than 2 same relations between two nodes

佐手、 提交于 2019-12-08 09:04:58
问题 Spent multiple days trying to figure out why this isn't working. My model is Player-[:PLAYED_WITH_TEAM]->team-[:CONTESTED_IN]->league . Few instances of this relation is as follows bob-[:PLAYED_WITH_TEAM]->falcons-[:CONTESTED_IN]->ABC League alice-[:PLAYED_WITH_TEAM]->falcons-[:CONTESTED_IN]->ABC League bob-[:PLAYED_WITH_TEAM]->falcons-[:CONTESTED_IN]->XYZLeague Bob played for the same team "Falcons" in two leagues ABC and XYZ. This is the fact i want to capture. Since Bob played for the same