2

我正在尝试使用 2 个并发线程重复添加 Neo4j 节点,并在下面反复突出显示 404 not found 问题。不确定这是一个错误还是我做错了什么

00:45:18.672 [Thread-1] INFO  org.neo4j.ogm.session.Neo4jSession - --------- new request ----------
00:45:18.672 [Thread-2] INFO  org.neo4j.ogm.session.Neo4jSession - --------- new request ----------
00:45:18.672 [Thread-1] INFO  org.neo4j.ogm.session.Neo4jSession - getOrCreateTransaction() being called on thread: 10
00:45:18.672 [Thread-2] INFO  org.neo4j.ogm.session.Neo4jSession - getOrCreateTransaction() being called on thread: 11
00:45:18.672 [Thread-1] INFO  org.neo4j.ogm.session.Neo4jSession - Session identity: org.neo4j.ogm.session.delegates.TransactionsDelegate@9257e6f
00:45:18.672 [Thread-2] INFO  org.neo4j.ogm.session.Neo4jSession - Session identity: org.neo4j.ogm.session.delegates.TransactionsDelegate@9257e6f
00:45:18.672 [Thread-1] INFO  org.neo4j.ogm.session.Neo4jSession - Current transaction: http://localhost:7474/db/data/transaction/399, tx id: org.neo4j.ogm.session.transaction.LongTransaction@61254e91
00:45:18.672 [Thread-2] INFO  org.neo4j.ogm.session.Neo4jSession - Current transaction: http://localhost:7474/db/data/transaction/398, tx id: org.neo4j.ogm.session.transaction.LongTransaction@16ff83ca
00:45:18.724 [Thread-2] INFO  o.n.o.session.request.DefaultRequest - POST http://localhost:7474/db/data/transaction/398, request: {"statements":[{"statement":"MATCH (n:`PortfolioEntity`) WHERE n.`name` = { `name` } WITH n MATCH p=(n)-[*0..4]-(m) RETURN collect(distinct p), ID(n)","parameters":{"name":"Chair"},"resultDataContents":["graph","row"],"includeStats":false}]}
00:45:18.724 [Thread-1] INFO  o.n.o.session.request.DefaultRequest - POST http://localhost:7474/db/data/transaction/399, request: {"statements":[{"statement":"MATCH (n:`PortfolioEntity`) WHERE n.`name` = { `name` } WITH n MATCH p=(n)-[*0..4]-(m) RETURN collect(distinct p), ID(n)","parameters":{"name":"Chair"},"resultDataContents":["graph","row"],"includeStats":false}]}
00:45:18.749 [Thread-2] INFO  o.n.o.session.request.DefaultRequest - Response is OK, creating response handler
00:45:18.749 [Thread-1] INFO  o.n.o.session.request.DefaultRequest - Response is OK, creating response handler
00:45:20.262 [Thread-1] INFO  o.n.o.session.response.JsonResponse - Closing HttpResponse
00:45:20.262 [Thread-1] INFO  o.n.o.session.response.JsonResponse - Closing HttpResponse
00:45:20.264 [Thread-1] INFO  org.neo4j.ogm.session.Neo4jSession - --------- new request ----------
00:45:20.264 [Thread-1] INFO  org.neo4j.ogm.session.Neo4jSession - getOrCreateTransaction() being called on thread: 10
00:45:20.264 [Thread-1] INFO  org.neo4j.ogm.session.Neo4jSession - Session identity: org.neo4j.ogm.session.delegates.TransactionsDelegate@9257e6f
00:45:20.264 [Thread-1] INFO  org.neo4j.ogm.session.Neo4jSession - Current transaction: http://localhost:7474/db/data/transaction/399, tx id: org.neo4j.ogm.session.transaction.LongTransaction@61254e91
00:45:20.269 [Thread-2] INFO  o.n.o.session.response.JsonResponse - Closing HttpResponse
00:45:20.269 [Thread-2] INFO  o.n.o.session.response.JsonResponse - Closing HttpResponse
00:45:20.269 [Thread-2] INFO  org.neo4j.ogm.session.Neo4jSession - --------- new request ----------
00:45:20.269 [Thread-2] INFO  org.neo4j.ogm.session.Neo4jSession - getOrCreateTransaction() being called on thread: 11
00:45:20.269 [Thread-2] INFO  org.neo4j.ogm.session.Neo4jSession - Session identity: org.neo4j.ogm.session.delegates.TransactionsDelegate@9257e6f
00:45:20.269 [Thread-2] INFO  org.neo4j.ogm.session.Neo4jSession - Current transaction: http://localhost:7474/db/data/transaction/398, tx id: org.neo4j.ogm.session.transaction.LongTransaction@16ff83ca
00:45:20.299 [Thread-1] INFO  o.n.o.session.request.DefaultRequest - POST http://localhost:7474/db/data/transaction/399, request: {"statements":[{"statement":"CREATE (_0:`ThingEntity`{_0_props}), (_2:`ThingDescriptorProfileEntity`) WITH _0,_2 MERGE (_0)-[_1:`DESCRIPTOR_PROFILE`]->(_2) WITH _0,_1,_2 MATCH ($1) WHERE id($1)=1 MERGE (_2)-[_3:`PROFILE_ATTRIBUTES`{value:{_3_props}.value}]->($1) WITH $1,_0,_1,_2,_3 MATCH ($4) WHERE id($4)=4 MERGE (_2)-[_4:`PROFILE_ATTRIBUTES`{value:{_4_props}.value}]->($4) WITH $1,$4,_0,_1,_2,_3,_4 MATCH ($5) WHERE id($5)=5 MERGE (_2)-[_5:`PROFILE_ATTRIBUTES`{value:{_5_props}.value}]->($5) RETURN id(_0) AS _0, id(_1) AS _1, id(_2) AS _2, id(_3) AS _3, id(_4) AS _4, id(_5) AS _5","parameters":{"_4_props":{"createdOn":null,"createdBy":null,"value":"2.4","updatedOn":null,"updatedBy":null},"_0_props":{"contextId":123,"displayLabel":"Chair","name":"Chair 1435691718464","geometryJSON":"\"id\": \"9f172893-ebe8-400c-818d-964cd29ca28d\",\n      \"type\": \"Chair\",\n      \"name\": \"Chair 4\",\n      \"shapeType\": \"POLYGON\",\n      \"micelloAid\": \"inlay_13034186\",\n      \"level\": {\n        \"levelId\": 6939,\n        \"levelName\": \"2\"\n      },\n      \"shape\": [\n        [\n          0,\n          614.927,\n          220.721\n        ],\n        [\n          1,\n          620.647,\n          220.721\n        ],\n        [\n          1,\n          620.647,\n          225.556\n        ],\n        [\n          1,\n          614.927,\n          225.556\n        ],\n        [\n          1,\n          614.927,\n          220.721\n        ],\n        [\n          4\n        ],\n        [\n          0,\n          614.078,\n          224.818\n        ],\n        [\n          1,\n          614.927,\n          224.818\n        ],\n        [\n          1,\n          614.927,\n          221.22\n        ],\n        [\n          1,\n          614.078,\n          221.22\n        ],\n        [\n          1,\n          614.078,\n          224.818\n        ],\n        [\n          4\n        ],\n        [\n          0,\n          620.647,\n          224.818\n        ],\n        [\n          1,\n          621.496,\n          224.818\n        ],\n        [\n          1,\n          621.496,\n          221.22\n        ],\n        [\n          1,\n          620.647,\n          221.22\n        ],\n        [\n          1,\n          620.647,\n          224.818\n        ],\n        [\n          4\n        ],\n        [\n          0,\n          615.462,\n          225.556\n        ],\n        [\n          1,\n          615.462,\n          226.405\n        ],\n        [\n          1,\n          620.112,\n          226.405\n        ],\n        [\n          1,\n          620.112,\n          225.556\n        ],\n        [\n          1,\n          615.462,\n          225.556\n        ],\n        [\n          4\n        ]\n      ],\n      \"tags\": [\n        \"Chair\"\n      ],\n      \"numOfSides\": 20,\n      \"coordinates\": {\n        \"x0\": 614.927,\n        \"y0\": 220.721,\n        \"x1\": 620.647,\n        \"y1\": 220.721,\n        \"x2\": 620.647,\n        \"y2\": 225.556,\n        \"x3\": 614.927,\n        \"y3\": 225.556,\n        \"x4\": 614.927,\n        \"y4\": 220.721,\n        \"x5\": 614.078,\n        \"y5\": 224.818,\n        \"x6\": 614.927,\n        \"y6\": 224.818,\n        \"x7\": 614.927,\n        \"y7\": 221.22,\n        \"x8\": 614.078,\n        \"y8\": 221.22,\n        \"x9\": 614.078,\n        \"y9\": 224.818,\n        \"x10\": 620.647,\n        \"y10\": 224.818,\n        \"x11\": 621.496,\n        \"y11\": 224.818,\n        \"x12\": 621.496,\n        \"y12\": 221.22,\n        \"x13\": 620.647,\n        \"y13\": 221.22,\n        \"x14\": 620.647,\n        \"y14\": 224.818,\n        \"x15\": 615.462,\n        \"y15\": 225.556,\n        \"x16\": 615.462,\n        \"y16\": 226.405,\n        \"x17\": 620.112,\n        \"y17\": 226.405,\n        \"x18\": 620.112,\n        \"y18\": 225.556,\n        \"x19\": 615.462,\n        \"y19\": 225.556\n      },\n      \"boundingBox\": [\n        {\n          \"x\": 614.078,\n          \"y\": 220.721\n        },\n        {\n          \"x\": 621.496,\n          \"y\": 220.721\n        },\n        {\n          \"x\": 621.496,\n          \"y\": 226.405\n        },\n        {\n          \"x\": 614.078,\n          \"y\": 226.405\n        }\n      ],\n      \"boundingBoxLatLong\": [\n        {\n          \"x\": 37.398372073328,\n          \"y\": -121.97868911353\n        },\n        {\n          \"x\": 37.39837204362,\n          \"y\": -121.97868309632\n        },\n        {\n          \"x\": 37.398367988524,\n          \"y\": -121.97868312804\n        },\n        {\n          \"x\": 37.398368018232,\n          \"y\": -121.97868914526\n        }\n      ]\n    }"},"_5_props":{"createdOn":null,"createdBy":null,"value":"1.4","updatedOn":null,"updatedBy":null},"_3_props":{"createdOn":null,"createdBy":null,"value":"Black","updatedOn":null,"updatedBy":null}},"resultDataContents":["row"],"includeStats":false}]}
00:45:20.299 [Thread-2] INFO  o.n.o.session.request.DefaultRequest - POST http://localhost:7474/db/data/transaction/398, request: {"statements":[{"statement":"CREATE (_0:`ThingEntity`{_0_props}), (_2:`ThingDescriptorProfileEntity`) WITH _0,_2 MERGE (_0)-[_1:`DESCRIPTOR_PROFILE`]->(_2) WITH _0,_1,_2 MATCH ($1) WHERE id($1)=1 MERGE (_2)-[_3:`PROFILE_ATTRIBUTES`{value:{_3_props}.value}]->($1) WITH $1,_0,_1,_2,_3 MATCH ($4) WHERE id($4)=4 MERGE (_2)-[_4:`PROFILE_ATTRIBUTES`{value:{_4_props}.value}]->($4) WITH $1,$4,_0,_1,_2,_3,_4 MATCH ($5) WHERE id($5)=5 MERGE (_2)-[_5:`PROFILE_ATTRIBUTES`{value:{_5_props}.value}]->($5) RETURN id(_0) AS _0, id(_1) AS _1, id(_2) AS _2, id(_3) AS _3, id(_4) AS _4, id(_5) AS _5","parameters":{"_4_props":{"createdOn":null,"createdBy":null,"value":"2.4","updatedOn":null,"updatedBy":null},"_0_props":{"contextId":123,"displayLabel":"Chair","name":"Chair 1435691718464","geometryJSON":"\"id\": \"9f172893-ebe8-400c-818d-964cd29ca28d\",\n      \"type\": \"Chair\",\n      \"name\": \"Chair 4\",\n      \"shapeType\": \"POLYGON\",\n      \"micelloAid\": \"inlay_13034186\",\n      \"level\": {\n        \"levelId\": 6939,\n        \"levelName\": \"2\"\n      },\n      \"shape\": [\n        [\n          0,\n          614.927,\n          220.721\n        ],\n        [\n          1,\n          620.647,\n          220.721\n        ],\n        [\n          1,\n          620.647,\n          225.556\n        ],\n        [\n          1,\n          614.927,\n          225.556\n        ],\n        [\n          1,\n          614.927,\n          220.721\n        ],\n        [\n          4\n        ],\n        [\n          0,\n          614.078,\n          224.818\n        ],\n        [\n          1,\n          614.927,\n          224.818\n        ],\n        [\n          1,\n          614.927,\n          221.22\n        ],\n        [\n          1,\n          614.078,\n          221.22\n        ],\n        [\n          1,\n          614.078,\n          224.818\n        ],\n        [\n          4\n        ],\n        [\n          0,\n          620.647,\n          224.818\n        ],\n        [\n          1,\n          621.496,\n          224.818\n        ],\n        [\n          1,\n          621.496,\n          221.22\n        ],\n        [\n          1,\n          620.647,\n          221.22\n        ],\n        [\n          1,\n          620.647,\n          224.818\n        ],\n        [\n          4\n        ],\n        [\n          0,\n          615.462,\n          225.556\n        ],\n        [\n          1,\n          615.462,\n          226.405\n        ],\n        [\n          1,\n          620.112,\n          226.405\n        ],\n        [\n          1,\n          620.112,\n          225.556\n        ],\n        [\n          1,\n          615.462,\n          225.556\n        ],\n        [\n          4\n        ]\n      ],\n      \"tags\": [\n        \"Chair\"\n      ],\n      \"numOfSides\": 20,\n      \"coordinates\": {\n        \"x0\": 614.927,\n        \"y0\": 220.721,\n        \"x1\": 620.647,\n        \"y1\": 220.721,\n        \"x2\": 620.647,\n        \"y2\": 225.556,\n        \"x3\": 614.927,\n        \"y3\": 225.556,\n        \"x4\": 614.927,\n        \"y4\": 220.721,\n        \"x5\": 614.078,\n        \"y5\": 224.818,\n        \"x6\": 614.927,\n        \"y6\": 224.818,\n        \"x7\": 614.927,\n        \"y7\": 221.22,\n        \"x8\": 614.078,\n        \"y8\": 221.22,\n        \"x9\": 614.078,\n        \"y9\": 224.818,\n        \"x10\": 620.647,\n        \"y10\": 224.818,\n        \"x11\": 621.496,\n        \"y11\": 224.818,\n        \"x12\": 621.496,\n        \"y12\": 221.22,\n        \"x13\": 620.647,\n        \"y13\": 221.22,\n        \"x14\": 620.647,\n        \"y14\": 224.818,\n        \"x15\": 615.462,\n        \"y15\": 225.556,\n        \"x16\": 615.462,\n        \"y16\": 226.405,\n        \"x17\": 620.112,\n        \"y17\": 226.405,\n        \"x18\": 620.112,\n        \"y18\": 225.556,\n        \"x19\": 615.462,\n        \"y19\": 225.556\n      },\n      \"boundingBox\": [\n        {\n          \"x\": 614.078,\n          \"y\": 220.721\n        },\n        {\n          \"x\": 621.496,\n          \"y\": 220.721\n        },\n        {\n          \"x\": 621.496,\n          \"y\": 226.405\n        },\n        {\n          \"x\": 614.078,\n          \"y\": 226.405\n        }\n      ],\n      \"boundingBoxLatLong\": [\n        {\n          \"x\": 37.398372073328,\n          \"y\": -121.97868911353\n        },\n        {\n          \"x\": 37.39837204362,\n          \"y\": -121.97868309632\n        },\n        {\n          \"x\": 37.398367988524,\n          \"y\": -121.97868312804\n        },\n        {\n          \"x\": 37.398368018232,\n          \"y\": -121.97868914526\n        }\n      ]\n    }"},"_5_props":{"createdOn":null,"createdBy":null,"value":"1.4","updatedOn":null,"updatedBy":null},"_3_props":{"createdOn":null,"createdBy":null,"value":"Black","updatedOn":null,"updatedBy":null}},"resultDataContents":["row"],"includeStats":false}]}
00:45:20.305 [Thread-2] INFO  o.n.o.session.request.DefaultRequest - Response is OK, creating response handler
00:45:20.307 [Thread-2] INFO  o.n.o.session.response.JsonResponse - Closing HttpResponse
00:45:20.307 [Thread-2] INFO  o.n.o.session.response.JsonResponse - Closing HttpResponse
00:45:20.308 [Thread-2] INFO  o.s.d.n.t.Neo4jTransactionManager - Commit requested: http://localhost:7474/db/data/transaction/398, status: PENDING
00:45:20.308 [Thread-2] INFO  o.s.d.n.t.Neo4jTransactionManager - Commit deferred
00:45:20.308 [Thread-2] INFO  o.s.d.n.t.Neo4jTransactionManager - Commit requested: http://localhost:7474/db/data/transaction/399, status: OPEN
00:45:20.308 [Thread-2] INFO  o.s.d.n.t.Neo4jTransactionManager - Commit invoked
00:45:20.308 [Thread-2] INFO  o.n.o.s.t.TransactionManager - POST http://localhost:7474/db/data/transaction/399/commit
00:45:20.311 [Thread-2] INFO  o.n.o.s.t.TransactionManager - Status code: 404
00:45:20.317 [Thread-2] WARN  o.s.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.transaction.TransactionalTestExecutionListener@5130f58e] to process 'after' execution for test: method [public void com.cisco.couture.core.portfolio.test.PortfolioServiceTest.addChairThing()], instance [com.cisco.couture.core.portfolio.test.PortfolioServiceTest@a3e0244], exception [null]
org.neo4j.ogm.session.result.ResultProcessingException: Failed to execute request: 
    at org.neo4j.ogm.session.transaction.TransactionManager.executeRequest(TransactionManager.java:116) ~[neo4j-ogm-1.1.0.jar:na]
    at org.neo4j.ogm.session.transaction.TransactionManager.commit(TransactionManager.java:74) ~[neo4j-ogm-1.1.0.jar:na]
    at org.neo4j.ogm.session.transaction.LongTransaction.commit(LongTransaction.java:34) ~[neo4j-ogm-1.1.0.jar:na]
    at org.springframework.data.neo4j.transaction.Neo4jTransactionManager.commit(Neo4jTransactionManager.java:49) ~[spring-data-neo4j-4.0.0.BUILD-SNAPSHOT.jar:na]
    at org.springframework.test.context.transaction.TransactionalTestExecutionListener$TransactionContext.endTransaction(TransactionalTestExecutionListener.java:597) ~[spring-test-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.test.context.transaction.TransactionalTestExecutionListener.endTransaction(TransactionalTestExecutionListener.java:296) ~[spring-test-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:189) ~[spring-test-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:416) ~[spring-test-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:91) [spring-test-4.0.6.RELEASE.jar:4.0.6.RELEASE]
    at org.databene.contiperf.junit.JUnitInvoker.invoke(JUnitInvoker.java:43) [contiperf-2.3.4.jar:na]
    at org.databene.contiperf.util.InvokerProxy.invoke(InvokerProxy.java:38) [contiperf-2.3.4.jar:na]
    at org.databene.contiperf.PerformanceTracker.invoke(PerformanceTracker.java:87) [contiperf-2.3.4.jar:na]
    at org.databene.contiperf.CountRunner.run(CountRunner.java:44) [contiperf-2.3.4.jar:na]
    **at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]
Caused by: org.apache.http.client.HttpResponseException: Not Found
    at** org.neo4j.ogm.session.transaction.TransactionManager.executeRequest(TransactionManager.java:93) ~[neo4j-ogm-1.1.0.jar:na]
    ... 13 common frames omitted
4

0 回答 0