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 .