Using SQL on ODB 2.2 or 3.0, I have an application that will frequently add a new vertex and a new edge from an existing vertex to the new vertex. This has a high likelihood of happening simultaneously from multiple clients (it is a high concurrency environment). But if client A creates the new vertex and the new edge, and client B comes along right after, client B does not need to create the new edge or vertex (it simply needs to follow the edge and operate on the new vertex).
I have to create the new vertex first, since I can’t create an edge between two vertexes until both of them exist. But until the new edge is created, client B would have no way to know that the new vertex exists. So what would prevent client B from just creating its own “new” vertex and edge?
So the question is: What is the best way to allow “the first” client to create the new edge and vertex and letting “the subsequent” clients simply use what the first client has already created, considering that all clients would be capable of creating the new vertex and edge if it doesn’t already exist?
Note, too, that this is a simplified example. The real use-case is that “the first” client would potentially create a set of new vertexes and a “chain” of edges linking them all.