I have a question regarding what would be the most efficient way to persist 
a collection of nodes where each node in the collection has a property that 
is a LINKSET to other nodes.

To make the question more concrete, I'll use a specific example. Let's say 
that we have a collection of person records (person is a class of vertex 
type) that has a number of properties including a set of addresses. Address 
itself should be a class of vertex type and furthermore, each address 
should have a property which is a link to the person record to which the 
address belongs to. This is necessary because if we need to traverse the 
graph starting from a node of address type, we should be able to 
efficiently locate the person to which the address belongs to.

I was hoping to persist the whole collection of person nodes in one 
transaction but I am running into trouble with temporary ids. If we take a 
single person record as an example, I need to create the vertex for the 
person record (gets a rid of #11:-2), I then create a couple of vertices of 
address type with a link to the person record, and then I set the property 
"addresses" (of type LINKSET) of the person record with value the set of 
addresses that were created. I am running into various exceptions so, I 
suspect that the way I am trying to achieve this is wrong. This scenario 
worked using the OGraphDatabase API but I am having trouble getting it to 
work with the Blueprints API.

I tried breaking it into 3 transactions, one to commit the person vertex, a 
second one to commit the collection of address vertices and a third to set 
the addresses property on the person vertex but this still does not work 
(in a multi-threaded scenario). I also tried using the save() method on the 
underlying object of a vertex and even using save(true) to force the save 
operation, but I am still getting exceptions.

Thanks,
Odysseas

-- 

--- 
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