I noticed this behavior while using py2neo 2.0.6, when I attempt to create
a Node that violates a unique constraint.
Nigel suggested I bring it up here.
Problem:
--------------
When a transaction attempts to create a resource with a unique constraint,
if the transaction fails with a
`py2neo.cypher.error.schema.ConstraintViolation` error, any subsequent
transactions that attempt to use the resource fail.
Steps:
---------
1. Create unique constraint on a label, e.g. Person (name)
2. Create a node (Person {name: "John"}) using the `CypherTransaction`
3. Attempt to create a node with the same name: (Person {name: "John"}),
py2neo throws a `py2neo.cypher.error.schema.ConstraintViolation`, from Neo4j
4. Attempt to delete the node, it fails with a `SocketTimeoutError`
To prevent the SocketTimeout error, one must rollback the transaction,
that's `tx.rollback()`, before attempting step 4.
I'm not sure if this is intentional, so we can control our transactions
ourselves. But it leaves the db in an inconsistent state if we don't
rollback the transaction.
Maybe for certain cases, like `ConstraintViolation` errors, the transaction
could be automatically rolled back.
Is this made intentional, and if so, may I ask why?
Thanks
Original post is here <https://github.com/nigelsmall/py2neo/issues/396>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.