How many requests are sent when we add several properties to a vertex?

12 views
Skip to first unread message

Alexandr Porunov

unread,
Dec 24, 2017, 4:29:21 AM12/24/17
to Ferma List
Hello,
I am a little bit confused about requests which are sent to a database when we are using a graph.
Here is an example:

Person p1 = fg.addFramedVertex(Person.class);
p1.setName("Jeff");
p1.setAge(30);
p1.setEmail("per...@gmail.com");

How many requests are sent when we are using above code? 4 requests? 2 requests? 1 request?

Best regards,
Alexandr

Jeffrey Freeman

unread,
Dec 24, 2017, 4:52:45 AM12/24/17
to Alexandr Porunov, Ferma List
Four, but if your using a transactional graph database then no changes will be persisted until committed.

--
You received this message because you are subscribed to the Google Groups "Ferma List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ferma-list+unsubscribe@syncleus.com.
To post to this group, send email to ferma...@syncleus.com.
To view this discussion on the web visit https://groups.google.com/a/syncleus.com/d/msgid/ferma-list/ec79d214-9f12-4fb5-934e-8ba2fc1e94b6%40syncleus.com.

Alexandr Porunov

unread,
Dec 24, 2017, 5:19:03 AM12/24/17
to Ferma List, alexandr...@gmail.com
Thank you very much!

Now it is clear. I am using Janusgraph on top of Cassandra. To commit changes I am using this code:

        Graph graph = JanusGraphFactory.build().
                set("storage.backend", "cassandra").
                set("storage.hostname", "10.10.10.50").
                set("storage.username", "cassandra").
                set("storage.password", "cassandra").
                set("index.search.backend", "elasticsearch").
                set("index.search.hostname", "10.10.10.50").
                set("index.search.hostname", "10.10.10.50").
                open();

        FramedGraph fg = new DelegatingFramedGraph<>(graph, true, types);

        Person jeff = fg.addFramedVertex(Programmer.class);
        jeff.setName("Jeff");

        Person julia = fg.addFramedVertex(Person.class);
        julia.setName("Julia");

        graph.tx().commit();

I see that only one request is sent in this scenario. Thank you again.

Best regards,
Alexandr

On Sunday, December 24, 2017 at 11:52:45 AM UTC+2, Jeffrey Phillips Freeman wrote:
Four, but if your using a transactional graph database then no changes will be persisted until committed.
On Dec 24, 2017 4:29 AM, "Alexandr Porunov" <alexandr...@gmail.com> wrote:
Hello,
I am a little bit confused about requests which are sent to a database when we are using a graph.
Here is an example:

Person p1 = fg.addFramedVertex(Person.class);
p1.setName("Jeff");
p1.setAge(30);
p1.setEmail("per...@gmail.com");

How many requests are sent when we are using above code? 4 requests? 2 requests? 1 request?

Best regards,
Alexandr

--
You received this message because you are subscribed to the Google Groups "Ferma List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ferma-list+...@syncleus.com.

Jeffrey Freeman

unread,
Dec 24, 2017, 5:34:21 AM12/24/17
to Alexandr Porunov, Ferma List
Happy to help, let me know if you have any other questions.

To unsubscribe from this group and stop receiving emails from it, send an email to ferma-list+unsubscribe@syncleus.com.

To post to this group, send email to ferma...@syncleus.com.
Reply all
Reply to author
Forward
0 new messages