I use java api .... The code is :

ODocument a= new Document('A');
a.save();
ODocument b= db.load(b_id);
b.field('a',a);
b.save();
db.commit();<- throws exception

 because b.field is saving a ORID with -1:10 .... 





Il giorno venerdì 5 giugno 2015 12:33:35 UTC+2, Luigi Dell'Aquila ha 
scritto:
>
> Hi Cristian,
>
> if you use Java API this is transparent, you can just create the document 
> and connect it to the rest of your data, OrientDB will replace temporary 
> RIDs with final values at commit time
>
> Luigi
>
>
> 2015-06-05 12:32 GMT+02:00 Cristian Lorenzetto <[email protected] 
> <javascript:>>:
>
>> I thought a solution for it in the case no other better solution actually 
>> exists  :
>>
>> when i create a document inside the transaction the id is valid but point 
>> to a special cluster (transaction cluster) so i can 
>> associate it in other odocuments ... without exceptions 
>> when i make commit orientdb remap the associations with the right new 
>> real id :) :) 
>>
>>
>>
>> Il giorno venerdì 5 giugno 2015 12:19:35 UTC+2, Cristian Lorenzetto ha 
>> scritto:
>>>
>>> in many cases i have a transaction and 
>>> inside this transaction i have to create a new document and then to bind 
>>> it to another document. 
>>>
>>> when you create a new document, it has a invalid id until you make a 
>>> commit. Is there other solutions?
>>>
>>>
>>> The  solution acctually is :
>>> to make a commit after document creation and in case of rollback i have 
>>> to remove document manually
>>>  but is there other better solution ?
>>> for example if i create a nested transaction for the document creation i 
>>> can have correct it ?
>>>
>>  -- 
>>
>> --- 
>> 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] <javascript:>.
>> 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.

Reply via email to