/** * Sets a property value * * @param iName Property name * @param iValue new value to set * * @return The previous value if any, otherwise null */ public Object setProperty(final String iName, final Object iValue) { if (pool != null) pool.setProperty(iName, iValue); if (iValue != null) return properties.put(iName.toLowerCase(Locale.ENGLISH), iValue); else return properties.remove(iName.toLowerCase(Locale.ENGLISH)); }
/** * 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 */ 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; }