public Person createPerson( int id, String name ) throws Exception {
        Transaction tx = graphDb.beginTx();
        try {
            Node newPersonNode = graphDb.createNode();
            personRefNode.createRelationshipTo( newPersonNode, A_PERSON );
            // lock now taken, we can check if already exist in index
            Node alreadyExist = index.get( Person.ID, id ).getSingle();
            if ( alreadyExist != null ) {
                tx.failure();
                throw new Exception( "Person with this id already exists " );
            }
            newPersonNode.setProperty( Person.NAME, name );
            newPersonNode.setProperty(Person.ID, id);
            index.add( newPersonNode, Person.ID, id );
            tx.success();
            return new Person(newPersonNode) ;
        }
        finally {
            tx.finish();
        }
    }