Hello Praveen,

it is not so easy to create vertices and edges in one batch execution. You 
need the document handle (document field "_id") of the vertices for the 
function createGraphEdge().

Example:
        driver.startBatchMode();
        final DocumentEntity<TestComplexEntity03> v1 = 
driver.graphCreateVertex(this.graphName, this.collectionName,
            new TestComplexEntity03("v1-user", "desc1", 10), null);
        final DocumentEntity<TestComplexEntity03> v2 = 
driver.graphCreateVertex(this.graphName, this.collectionName,
            new TestComplexEntity03("v2-user", "desc2", 12), null);
        driver.graphCreateEdge(this.graphName, edgeCollectionName, null, 
v1.getDocumentHandle(), v2.getDocumentHandle(), null, null);
        driver.executeBatch();

In this example v1.getDocumentHandle() and v2.getDocumentHandle() is null 
and so createGraphEdge() fails.

If you know the document key of a vertex you can build the document handle 
by "collectionName" + "/" + "documentKey".

I added a test file 
<https://github.com/arangodb/arangodb-java-driver/blob/3.0/src/test/java/com/arangodb/ArangoDriverBatchGraphTest.java>
 
to the git repo.


Am Mittwoch, 17. August 2016 09:30:48 UTC+2 schrieb 
[email protected]:
>
> Hi,
>
> I'm using ArangoDB to build a POC. I'm using the Batch mode with the Java 
> driver to build the application.
>
> The Vertices are getting updated in Batch but the edges are not getting 
> updated at all. The same code works
> if the Batch mode is removed.
>
> Thanks,
> Praveen
>

-- 
You received this message because you are subscribed to the Google Groups 
"ArangoDB" 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.

Reply via email to