HI, 1. You should set not rids but records itself they will be converted into valid links automatically during commit. 2. Why you do not use edges instead of direct links if you use graph database ?
On Fri, Mar 7, 2014 at 6:00 PM, Odysseas <[email protected]> wrote: > > 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. > -- Best regards, Andrey Lomakin. Orient Technologies the Company behind OrientDB -- --- 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.
