Class OPartitionedDatabasePool

java.lang.Object
com.orientechnologies.orient.core.OOrientListenerAbstract
com.orientechnologies.orient.core.db.OPartitionedDatabasePool
All Implemented Interfaces:
OOrientListener, OOrientShutdownListener, OOrientStartupListener

@Deprecated public class OPartitionedDatabasePool extends OOrientListenerAbstract
Deprecated.
Database pool which has good multicore scalability characteristics because of creation of several partitions for each logical thread group which drastically decrease thread contention when we acquire new connection to database.

To acquire connection from the pool call acquire() method but to release connection you just need to call ODatabase.close() method.

In case of remote storage database pool will keep connections to the remote storage till you close pool. So in case of remote storage you should close pool at the end of it's usage, it also may be closed on application shutdown but you should not rely on this behaviour.

This pool has one noticeable difference from other pools. If you perform several subsequent acquire calls in the same thread the same instance of database will be returned, but amount of calls to close method should match to amount of acquire calls to release database back in the pool. It will allow you to use such feature as transaction propagation when you perform call of one service from another one.

Given pool has two parameters now, amount of maximum connections for single partition and total amount of connections which may be hold by pool. When you start to use pool it will automatically split by several partitions, each partition is independent from other which gives us very good multicore scalability. Amount of partitions will be close to amount of cores but it is not mandatory and depends how much application is loaded. Amount of connections which may be hold by single partition is defined by user but we suggest to use default parameters if your application load is not extremely high.

If total amount of connections which allowed to be hold by this pool is reached thread will wait till free connection will be available. If total amount of connection is set to value 0 or less it means that there is no connection limit.

Since:
06/11/14
Author:
Andrey Lomakin (a.lomakin-at-orientdb.com)
  • Field Details

  • Constructor Details

    • OPartitionedDatabasePool

      @Deprecated public OPartitionedDatabasePool(String url, String userName, String password)
      Deprecated.
    • OPartitionedDatabasePool

      @Deprecated public OPartitionedDatabasePool(String url, String userName, String password, int maxPartitionSize, int maxPoolSize)
      Deprecated.
  • Method Details

    • getUrl

      public String getUrl()
      Deprecated.
    • getUserName

      public String getUserName()
      Deprecated.
    • getMaxPartitonSize

      public int getMaxPartitonSize()
      Deprecated.
    • getAvailableConnections

      public int getAvailableConnections()
      Deprecated.
    • getCreatedInstances

      public int getCreatedInstances()
      Deprecated.
    • acquire

      public ODatabaseDocumentTx acquire()
      Deprecated.
    • isAutoCreate

      public boolean isAutoCreate()
      Deprecated.
    • setAutoCreate

      public OPartitionedDatabasePool setAutoCreate(boolean autoCreate)
      Deprecated.
    • isClosed

      public boolean isClosed()
      Deprecated.
    • openDatabase

      protected void openDatabase(com.orientechnologies.orient.core.db.OPartitionedDatabasePool.DatabaseDocumentTxPooled db)
      Deprecated.
    • onShutdown

      public void onShutdown()
      Deprecated.
      Specified by:
      onShutdown in interface OOrientListener
      Specified by:
      onShutdown in interface OOrientShutdownListener
      Overrides:
      onShutdown in class OOrientListenerAbstract
    • onStartup

      public void onStartup()
      Deprecated.
      Specified by:
      onStartup in interface OOrientStartupListener
      Overrides:
      onStartup in class OOrientListenerAbstract
    • close

      public void close()
      Deprecated.
    • setProperty

      public Object setProperty(String iName, Object iValue)
      Deprecated.
      Sets a property value
      Parameters:
      iName - Property name
      iValue - new value to set
      Returns:
      The previous value if any, otherwise null
    • getProperty

      public Object getProperty(String iName)
      Deprecated.
      Gets the property value.
      Parameters:
      iName - Property name
      Returns:
      The previous value if any, otherwise null