title: Issue with creating edge in OrientDb with Blueprints / Tinkerpop
body: <p>I am recently trying to learn OrientDb and now that I am somewhat familiar with the OrientDb console itself I am moving on to using Blueprints to write a simple java program to create a graph. I am trying to create a few vertices and edges between them, but although my vertices are created successfully, I am unable to see my edges unless I call the method for creation twice. If I comment out one of the calls, none of the edges are being created. I tried checking for any timing issues by adding sleep times, but nothing seems to help.</p>
  
  <p>I tried to check using the console and I see the vertices created but not the edges. I am running 1.7 rc-1 for orient.</p>
  
  <p>Here is the sample code I am trying to get working:</p>
  
  <pre><code>public class OrientPrototype {
      static OrientGraph graph = new OrientGraph("remote:localhost/Tinker", "admin", "admin");
  
      public static void main( String[] args ) {
  
          removeAllExistingVerticesAndEdges();
  
          createSimpleGraph();
  
          displayAllVertices(getAllVertices("Person"), "name");
  
          displayAllEdges(getAllEdges("Friend"));
      }
  
      private static void removeAllExistingVerticesAndEdges() {
          for (Vertex v : graph.getVertices())
              v.remove();
  
          for (Edge e : graph.getEdges())
              e.remove();
      }
  
      private static void createSimpleGraph() throws InterruptedException {
  
          createPersons();
  
          createFriendships();
          //createFriendships();
      }
  
      private static void createPersons() {
          String [] persons = {"John", "Jack", "Ryan"};
  
          if (graph.getVertexType("Person") == null)
              graph.createVertexType("Person");
  
          for (int i = 0; i &lt; persons.length; i++) {
              try {
                  Vertex v = graph.addVertex("class:Person");
                  v.setProperty("name", persons[i]);
                  graph.commit();
              }
              catch (Exception e) {
                  graph.rollback();
                  System.out.println("Error while creating the persons. Had to roll back");
              }
          }       
          System.out.println("Done creating vertices...");
      }
  
      private static void createFriendships() {
          if (graph.getEdgeType("Friend") == null) {
              graph.createEdgeType("Friend");
              graph.commit();
          }
  
          Map&lt;String, Vertex&gt; vertices = new HashMap&lt;String, Vertex&gt;();
          for (Vertex v : graph.getVertices())
              vertices.put(v.getProperty("name").toString(), v);
  
          try {
              graph.addEdge("class:Friend", vertices.get("John"), vertices.get("Jack"), "is friend");
              graph.addEdge("class:Friend", vertices.get("Jack"), vertices.get("Ryan"), "is friend");
              graph.addEdge("class:Friend", vertices.get("Ryan"), vertices.get("John"), "is friend");
  
  
              graph.commit();
              System.out.println("Done creating edges...");
  
          }
          catch (Exception e) {
              graph.rollback();
              System.out.println("Error while creating the edges between persons. Had to roll back");
          }
      }
  
      private static Iterable&lt;Vertex&gt; getAllVertices(String classname) {
          return graph.getVerticesOfClass(classname);
      }
  
      private static void displayAllVertices(Iterable&lt;Vertex&gt; it, String propertyName) {
          System.out.println("The vertices in the graph are:");
          for (Vertex v: it)
              System.out.println(v + " " + v.getProperty("name"));
      }
  
      private static Iterable&lt;Edge&gt; getAllEdges(String classname) {
          return graph.getEdgesOfClass(classname);
      }
  
      private static void displayAllEdges(Iterable&lt;Edge&gt; it) {
          System.out.println("The edges in the graph are:");
          for (Edge e: it)
              System.out.println(e);
      }
  }
  </code></pre>
  
  <p>I do not believe that I am doing something wrong because when I look at the console for OrientDb, I do not see any Edges in the Schema tab for class Friend when I make the single call to createEdge method? These do appear however after the second call. Moreover I also see the incoming and outgoing links to the Person class when I run a select from Person query on the Person class. These incoming and outgoing links appear only when I call the createEdge method at least once. </p>
  
  <p>Any help is greatly appreciated. Also attaching the dependencies from my maven pom file if it is of any help:</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.tinkerpop.blueprints&lt;/groupId&gt;
          &lt;artifactId&gt;blueprints-orient-graph&lt;/artifactId&gt;
          &lt;version&gt;2.5.0-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.tinkerpop.gremlin&lt;/groupId&gt;
          &lt;artifactId&gt;gremlin-java&lt;/artifactId&gt;
          &lt;version&gt;2.5.0-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.orientechnologies&lt;/groupId&gt;
          &lt;artifactId&gt;orient-commons&lt;/artifactId&gt;
          &lt;version&gt;1.7-rc1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.orientechnologies&lt;/groupId&gt;
          &lt;artifactId&gt;orientdb-core&lt;/artifactId&gt;
          &lt;version&gt;1.7-rc1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.orientechnologies&lt;/groupId&gt;
          &lt;artifactId&gt;orientdb-client&lt;/artifactId&gt;
          &lt;version&gt;1.7-rc1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.orientechnologies&lt;/groupId&gt;
          &lt;artifactId&gt;orientdb-object&lt;/artifactId&gt;
          &lt;version&gt;1.7-rc1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.orientechnologies&lt;/groupId&gt;
          &lt;artifactId&gt;orientdb-enterprise&lt;/artifactId&gt;
          &lt;version&gt;1.7-rc1&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>