On 20 April 2014 06:10, Aditya Gote <[email protected]> wrote: > We are using : *orientdb-community-1.7rc2* > > We are undergrad students working on REST implementation of OrientDB > We are facing a very strange behaviour. Let me explain what we are trying > to do. > We want to create an Edge between 2 Vertex and we want to do this for > batches. And perform batch commits. > We are first retrieving 2 Vertex. Then we create an Edge between these 2 > Vertices. > Then we are setting a property for this newly created Edge. > The code looks as follows: > > try { > if(!isTransactionAlive) > isTransactionAlive = true; > Vertex v1 = getUser(friendid1); > Vertex v2 = getUser(friendid2); > if (v1 == null || v2 == null) { > System.out.println("Error in CreateFriendship() function iterator!!!"); > return ERROR; > } > Edge relation1 = GraphDBService.addEdge("class:friend", v1, v2, "friend"); > Edge relation2 = GraphDBService.addEdge("class:friend", v2, v1, > "friend"); > relation1.setProperty("status", CONFIRMED); > relation2.setProperty("status", CONFIRMED); > count++; > if (isTransactionAlive && (count >= userCount / threadCount) ) { > GraphDBService.commit(); > count = 0; > isTransactionAlive = false; > } > return SUCCESS; > } > catch (Exception e) { > GraphDBService.rollback(); > System.out.println("Exception: Error in CreateFriendship() function!!!"); > return ERROR; > } > > In case of commit() done under if-condition, the problem arises. The > problem comes when the setProperty() is executed. > The vIn and vOut are set to NULL after this statement. > And when we check the database, all we see is nodes. No Edges. "Select * > from friend" returns 0 >
Hi, the reason why you don't see Edges with a query is: https://github.com/orientechnologies/orientdb/wiki/Troubleshooting#why-i-cant-see-all-the-edges . About the vIn and vOut null seems a bug. May you check it against OrientDB 1.7-SNAPSHOT before to report the bug? If the commit is allowed to happen unconditionally, i.e no batch commits, > then everything works fine. > We have spent 2 days on this small issue but are not finding any solution. > Please help. > Lvc@ -- --- 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.
