cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How do I make it so multiple request cant be made with session.run? REST api

My code is relatively simple. It just adds a person by name. If the same person is added again it deletes current one and readds it. So for example if I add a node with {name: "bob"} twice with localhost:8080/addPerson

There would only be a single bob node in the database. In postman this would work as I want it since it does things slowly

However in a test suite its much faster

res1 = requests.put('http://localhost:8080/addPerson', json={'name': 'bob'})
assert 200 == res1.status_code
res2 = requests.put('http://localhost:8080/addPerson', json={'name': 'bob'})
assert 200 == res2.status_code

This would create 2 bobs since it reads request2 before request1 gets finished. I'm new to NEO4j with java and I'm wondering is there a way to run one session at a time?

1 REPLY 1

u know do one request?