private int sequence(RowKey rowKey, int increment, final int initialValue) {
Transaction tx = neo4jDb.beginTx();
Lock lock = null;
try {
Node sequence = getOrCreateSequence( rowKey, initialValue );
lock = tx.acquireWriteLock( sequence );
int nextValue = updateSequenceValue( sequenceName( rowKey ), sequence, increment );
tx.success();
lock.release();
return nextValue;
}