graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientGraphFactory.java
public OrientGraphFactory setupPool(final int iMin, final int iMax) {
    if (pool != null) {
      pool.close();
    }

    pool = new OPartitionedDatabasePool(url, user, password, 8, iMax).setAutoCreate(true);

    properties.entrySet().forEach(p -> pool.setProperty(p.getKey(), p.getValue()));
    return this;
  }
public OrientGraphFactory setupPool(final int iMin, final int iMax) {
    if (pool != null) {
      pool.close();
    }

    pool = new OPartitionedDatabasePool(url, user, password, 8, iMax).setAutoCreate(true);

    properties.entrySet().forEach(p -> pool.setProperty(p.getKey(), p.getValue()));
    return this;
  }
Setting up the factory to use database pool instead of creation a new instance of database connection each time.

@param iMin minimum size of pool
@param iMax maximum size of pool

@return this