Riccardo,
I changed my delete method to use
g.command(*new* OCommandSQL("delete vertex from " + v.getProperty(
"@class") + " where @rid = '" + v.getId().toString() + "'")).execute();
It is still committed after each method. Here is a skeleton of my code
OrientGraph g = null;
try {
g = <get graph from pool>;
deleteChild(g);
// delete child is committed into database
// right after this call.
deleteParent(g);
....
}
finally {
if (g != null) {
g.rollback();
g.shutdown();
}
}
On Wednesday, September 30, 2015 at 11:34:17 AM UTC-4, Tai Hu wrote:
>
> I am using OrientGraph.removeVertex() method to delete vertex. I will give
> a try on OSQL command.
>
> Thanks,
>
> Tai
>
> On Wednesday, September 30, 2015 at 4:20:45 AM UTC-4, Riccardo Tasso wrote:
>>
>> Hi, as far as I know commands are executed in one transaction.
>>
>> Have you tried to use a OSQL statement such as:
>> DELETE VERTEX FROM OneClass WHERE something = 'somethingElse'
>>
>> Cheers,
>> Riccardo
>>
>> 2015-09-29 20:59 GMT+02:00 Tai Hu <[email protected]>:
>>
>>> I have a question regarding to transaction propagation. For my data
>>> model, I have bunch of delete methods to delete each individual type of
>>> vertex in OrientDB. However, I also have a big delete method which suppose
>>> to delete all types of object at once. This operation need to be ACID,
>>> either delete all of them or not at all. I created one OrientGraph object
>>> and pass it into all each individual methods. However, after each delete
>>> method, the operation is automatically commit. So if my big delete method
>>> failed half way, my OrientDB will be out of sync. I tried to call
>>> setAutoStartTx(false) on OrientGraph and manually called begin() method on
>>> OrientGraph, but transaction still automatically committed after each
>>> delete method. Is there any way to manually control my transaction in
>>> OrientGraph?
>>>
>>> Thanks,
>>>
>>> Tai
>>>
>>> --
>>>
>>> ---
>>> 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 [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
--
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.