Transactions

31 views
Skip to first unread message

Lorenzo Conti

unread,
May 24, 2012, 7:03:47 AM5/24/12
to OrientDB, d.deb...@gmail.com
Ciao Luca,
we're studying the features of OrientDB and I have a question:
which is the best practice, if exists, to manage transactions?
I ask you because we're trying to insert 1000 vertexes ,linking them
together like a chain (first linked to second, second to third
etc...), inside a single transaction but, when we commit we get
StackOverflowError.
A friend of us, that knows very well OrientDB, has suggested to commit
every n insert (where n in our case is 100).
Doing that, it works perfectly but the whole process is not anymore a
transaction (if I get an error inserting the 430th vertex, the latter
30 vertexes will be rollbacked, but the first 400 will remain..).
For example if I have to "add all" a set of friends, I need to be sure
that the whole operation (all the 1000 friends) has been done or not.
Is there a possibility to set the dimension of a transaction?

Thanks for your help

Lorenzo

Luca Garulli

unread,
May 24, 2012, 7:20:52 AM5/24/12
to orient-...@googlegroups.com, d.deb...@gmail.com
Ciao,
there are 2 limitations with transactions:
  1. works 100% in memory. This allow massive concurrent users against the same server because there aren't server-side resources involved
  2. save() in general is viral: it crosses all the tree/graph of relationships until a record is not dirty. This has been implemented using the recursion. In the Traverse operator we changed it to use an nested Iterator approach and works much better. A rewriting of that is planned. To overcome to the StackOverflowError problem you could enlarge the JVM Thread Stack settings or reduce the depth level.
Lvc@
Reply all
Reply to author
Forward
0 new messages