Explicit transactions with Graph API

127 views
Skip to first unread message

Sathwik B P

unread,
Feb 20, 2015, 3:32:34 AM2/20/15
to orient-...@googlegroups.com
Hi,

OrientDB 2.0.2

Would like to know how to disable implicit transactions when using Graph API.

Here is the piece of code

        OrientGraphFactory factory = new OrientGraphFactory("remote:localhost/test","root","orientdb");
        factory
.setAutoStartTx(false);
       
        factory
.setupPool(1,10);
       
       
OrientGraph graph = factory.getTx();
        graph
.createKeyIndex("name", Vertex.class);

        graph
.shutdown();
        factory
.close();


This puts out a warning saying that the transaction has been started.
Creating of key index throws a waring
WARNING: Requested command 'create key index on 'Vertex.name'' must be executed outside active transaction: the transaction will be committed and reopen right after it. To avoid this behavior execute it outside a transaction

This doesn't happen if the pool is not setup.

Setting the pool is creating an implicit transaction in the rawGraph.

Would like to know how to overcome the starting of implicit transactions.

regards,
sathwik

Chris Wilper

unread,
Feb 20, 2015, 1:57:53 PM2/20/15
to orient-...@googlegroups.com
I was curious about this as I've looked around at that code before and saw where it was setting these flags. Looks like a bug, I've reported it here w/details:


- Chris

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Wilper

unread,
Feb 20, 2015, 2:41:53 PM2/20/15
to orient-...@googlegroups.com
Note since the setting seems to be configured for the graph, it looks like you should be able to work around it by calling graph.rollback() immediately after getting it from the factory.

Sathwik B P

unread,
Feb 23, 2015, 8:08:26 AM2/23/15
to orient-...@googlegroups.com
Hi Chris,

Thanks for raising the defect.

regards,
sathwik

Luca Garulli

unread,
Feb 26, 2015, 3:05:47 PM2/26/15
to orient-database
Closed in 2.0.4-SNAPSHOT.

Lvc@

Reply all
Reply to author
Forward
0 new messages