For the tests you could use, tx.failure() instead of tx.success() to not commit anything to the database. And I think the constraints, they need to be checked from the application layer? Sent from my BlackBerry® wireless device
-----Original Message----- From: "doubleagent [via Neo4j Community Discussions]" <[email protected]> Date: Wed, 5 Oct 2011 17:13:33 To: noppanit<[email protected]> Subject: Recommended way to enforce constraints? I'm using the old matrix example to learn borneo (the Clojure wrapper), and I noticed that if I run unit tests neo4j will simply add new nodes to the graph, same signature and all, except that the node id is different. That makes sense - it's just not what I was expecting. What I would like to be able to do is add constraints to the graph ie nodes must have this property, it must be non-null, and it must be unique ... composite keys I suppose. How is this done? As it is, I need to remove the entire graph database directory and start fresh before each test. _______________________________________________ If you reply to this email, your message will be added to the discussion below: http://neo4j-community-discussions.438527.n3.nabble.com/Recommended-way-to-enforce-constraints-tp3398407p3398407.html To start a new topic under Neo4j Community Discussions, email [email protected] To unsubscribe from Neo4j Community Discussions, visit http://neo4j-community-discussions.438527.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=438527&code=bm9wcGFuaXQuY0BnbWFpbC5jb218NDM4NTI3fDExOTIzNzAyNjk= -- View this message in context: http://neo4j-community-discussions.438527.n3.nabble.com/Recommended-way-to-enforce-constraints-tp3398407p3398919.html Sent from the Neo4j Community Discussions mailing list archive at Nabble.com. _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

