Interface PersistenceManagerFactory

All Superinterfaces:
Serializable

public interface PersistenceManagerFactory extends Serializable
Author:
Craig Russell 2000
  • Method Details

    • setConnectionDriverName

      void setConnectionDriverName(String driverName)
      Sets JDBC driver name
      Parameters:
      driverName - JDBC driver name
    • getConnectionDriverName

      String getConnectionDriverName()
      Returns JDBC driver name
      Returns:
      driver name
    • setConnectionUserName

      void setConnectionUserName(String userName)
      Sets database user
      Parameters:
      userName - database user
    • getConnectionUserName

      String getConnectionUserName()
      Returns database user name
      Returns:
      current database user name
    • setConnectionPassword

      void setConnectionPassword(char[] password)
      Sets database user password
      Parameters:
      password - database user password
    • setConnectionMaxPool

      void setConnectionMaxPool(int MaxPool)
      Sets maximum number of connections in the connection pool
      Parameters:
      MaxPool - maximum number of connections
    • getConnectionMaxPool

      int getConnectionMaxPool()
      Returns maximum number of connections in the connection pool
      Returns:
      connectionMaxPool
    • setConnectionMinPool

      void setConnectionMinPool(int MinPool)
      Sets minimum number of connections in the connection pool
      Parameters:
      MinPool - minimum number of connections
    • getConnectionMinPool

      int getConnectionMinPool()
      Returns minimum number of connections in the connection pool
      Returns:
      connectionMinPool
    • setMaxPool

      void setMaxPool(int MaxPool)
      Sets maximum number of PersistenceManager instances in the pool
      Parameters:
      MaxPool - maximum number of instances
    • getMaxPool

      int getMaxPool()
      Returns maximum number of PersistenceManager instances in the pool
      Returns:
      maxPool
    • setMinPool

      void setMinPool(int MinPool)
      Sets minimum number of PersistenceManager instances in the pool
      Parameters:
      MinPool - minimum number of PersistenceManager instances
    • getMinPool

      int getMinPool()
      Returns minimum number of PersistenceManager instances in the pool
      Returns:
      minPool
    • setConnectionMsWait

      void setConnectionMsWait(int MsWait)
      Sets the number of milliseconds to wait for an available connection from the connection pool before throwing an exception
      Parameters:
      MsWait - number in milliseconds
    • getConnectionMsWait

      int getConnectionMsWait()
      Returns the number of milliseconds to wait for an available connection from the connection pool before throwing an exception
      Returns:
      number in milliseconds
    • setConnectionMsInterval

      void setConnectionMsInterval(int MsInterval)
      Sets the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection.
      Parameters:
      MsInterval - the interval between attempts to get a database connection, in milliseconds.
    • getConnectionMsInterval

      int getConnectionMsInterval()
      Returns the amount of time, in milliseconds, between the connection manager's attempts to get a pooled connection.
      Returns:
      the length of the interval between tries in milliseconds
    • setConnectionLoginTimeout

      void setConnectionLoginTimeout(int LoginTimeout)
      Sets the number of seconds to wait for a new connection to be established to the data source
      Parameters:
      LoginTimeout - wait time in seconds
    • getConnectionLoginTimeout

      int getConnectionLoginTimeout()
      Returns the number of seconds to wait for a new connection to be established to the data source
      Returns:
      wait time in seconds
    • setConnectionURL

      void setConnectionURL(String URL)
      Sets JDBC connection URL
      Parameters:
      URL - connection URL
    • getConnectionURL

      String getConnectionURL()
      Returns connection URL
      Returns:
      connection URL
    • setConnectionFactory

      void setConnectionFactory(Object cf)
      Sets Connection Factory as ConnectionFactory or javax.sql.DataSource
      Parameters:
      cf - as java.lang.Object
    • getConnectionFactory

      Object getConnectionFactory()
      Returns Connection Factory object that can be one of ConnectionFactory or javax.sql.DataSource
      Returns:
      Connection Factory as java.lang.Object
    • setConnectionLogWriter

      void setConnectionLogWriter(PrintWriter pw)
      Sets the LogWriter to which messages should be sent
      Parameters:
      pw - LogWriter
    • getConnectionLogWriter

      PrintWriter getConnectionLogWriter()
      Returns the LogWriter to which messages should be sent
      Returns:
      LogWriter
    • setConnectionTransactionIsolation

      void setConnectionTransactionIsolation(int level)
      Sets transaction isolation level for all connections of this PersistenceManagerFactory. All validation is done by java.sql.Connection itself, so e.g. while Oracle will not allow to set solation level to TRANSACTION_REPEATABLE_READ, this method does not have any explicit restrictions
      Parameters:
      level - - one of the java.sql.Connection.TRANSACTION_* isolation values
    • getConnectionTransactionIsolation

      int getConnectionTransactionIsolation()
      Returns current transaction isolation level for connections of this PersistenceManagerFactory.
      Returns:
      the current transaction isolation mode value as java.sql.Connection.TRANSACTION_*
    • setConnectionFactoryName

      void setConnectionFactoryName(org.glassfish.api.naming.SimpleJndiName connectionFactoryName)
      Sets ConnectionFactory name
      Parameters:
      connectionFactoryName - ConnectionFactory name
    • getConnectionFactoryName

      org.glassfish.api.naming.SimpleJndiName getConnectionFactoryName()
      Returns ConnectionFactory name
      Returns:
      ConnectionFactoryName
    • setIdentifier

      void setIdentifier(String identifier)
      Sets Identifier. An Identifier is a string that user can use to identify the PersistenceManagerFacory in a given environment. Identifier can be particularly useful in an environment where multiple PersistenceManagerFacories are initialized in a system.
      Parameters:
      identifier -
    • getIdentifier

      String getIdentifier()
      Gets Identifier. An Identifier is a string that user can use to identify the PersistenceManagerFacory in a given environment. Identifier can be particularly useful in an environment where multiple PersistenceManagerFacories are initialized in a system.
      Returns:
      identifier
    • getPersistenceManager

      PersistenceManager getPersistenceManager()
      Creates new PersistenceManager without extra info
      Returns:
      the persistence manager
    • getPersistenceManager

      PersistenceManager getPersistenceManager(String username, char[] password)
      Creates new PersistenceManager with specific username and password. Used to call ConnectionFactory.getConnection(String, String)
      Parameters:
      username - datasource user
      password - datasource user password
      Returns:
      the persistence manager
    • setOptimistic

      void setOptimistic(boolean flag)
      Sets the optimistic flag for all PersistenceManagers
      Parameters:
      flag - boolean optimistic flag
    • getOptimistic

      boolean getOptimistic()
      Returns the boolean value of the optimistic flag for all PersistenceManagers
      Returns:
      boolean optimistic flag
    • setRetainValues

      void setRetainValues(boolean flag)
      Sets flag that will not cause the eviction of persistent instances after transaction completion.
      Parameters:
      flag - boolean flag passed
    • getRetainValues

      boolean getRetainValues()
      Returns the boolean value for the flag that will not cause the eviction of persistent instances after transaction completion.
      Returns:
      boolean setting for the flag
    • setNontransactionalRead

      void setNontransactionalRead(boolean flag)
      Sets the flag that allows non-transactional instances to be managed in the cache.
      Parameters:
      flag - boolean flag passed
    • getNontransactionalRead

      boolean getNontransactionalRead()
      Returns the boolean value for the flag that allows non-transactional instances to be managed in the cache.
      Returns:
      boolean setting for the flag
    • setIgnoreCache

      void setIgnoreCache(boolean flag)
      Sets the flag that allows the user to request that queries be optimized to return approximate results by ignoring changed values in the cache.
      Parameters:
      flag - boolean flag passed
    • getIgnoreCache

      boolean getIgnoreCache()
      Returns the boolean value for the flag that allows the user to request that queries be optimized to return approximate results by ignoring changed values in the cache.
      Returns:
      boolean setting for the flag
    • setQueryTimeout

      void setQueryTimeout(int timeout)
      Sets the number of seconds to wait for a query statement to execute in the datastore associated with this PersistenceManagerFactory.
      Parameters:
      timeout - new timout value in seconds; zero means unlimited
    • getQueryTimeout

      int getQueryTimeout()
      Gets the number of seconds to wait for a query statement to execute in the datastore associated with this PersistenceManagerFactory.
      Returns:
      timout value in seconds; zero means unlimited
    • setUpdateTimeout

      void setUpdateTimeout(int timeout)
      Sets the number of seconds to wait for an update statement to execute in the datastore associated with this PersistenceManagerFactory.
      Parameters:
      timeout - new timout value in seconds; zero means unlimited
    • getUpdateTimeout

      int getUpdateTimeout()
      Gets the number of seconds to wait for an update statement to execute in the datastore associated with this PersistenceManagerFactory.
      Returns:
      timout value in seconds; zero means unlimited
    • getProperties

      Properties getProperties()
      Returns non-operational properties to be available to the application via a Properties instance.
      Returns:
      Properties object
    • getSupersedeDeletedInstance

      boolean getSupersedeDeletedInstance()
      Returns the boolean value of the supersedeDeletedInstance flag for all PersistenceManagers. If set to true, deleted instances are allowed to be replaced with persistent-new instances with the equal Object Id.
      Returns:
      boolean supersedeDeletedInstance flag
    • setSupersedeDeletedInstance

      void setSupersedeDeletedInstance(boolean flag)
      Sets the supersedeDeletedInstance flag for all PersistenceManagers.
      Parameters:
      flag - boolean supersedeDeletedInstance flag
    • getRequireCopyObjectId

      boolean getRequireCopyObjectId()
      Returns the default value of the requireCopyObjectId flag for this PersistenceManagerFactory. If set to false, the PersistenceManager will not create a copy of an ObjectId for PersistenceManager.getObjectId(Object pc) and PersistenceManager.getObjectById(Object oid) requests.
      Returns:
      boolean requireCopyObjectId flag
      See Also:
    • setRequireCopyObjectId

      void setRequireCopyObjectId(boolean flag)
      Sets the default value of the requireCopyObjectId flag. If set to false, by default a PersistenceManager will not create a copy of an ObjectId for PersistenceManager.getObjectId(Object pc) and PersistenceManager.getObjectById(Object oid) requests.
      Parameters:
      flag - boolean requireCopyObjectId flag
      See Also:
    • getRequireTrackedSCO

      boolean getRequireTrackedSCO()
      Returns the boolean value of the requireTrackedSCO flag for this PersistenceManagerFactory. If set to false, by default the PersistenceManager will not create tracked SCO instances for new persistent instances at commit with retainValues set to true and while retrieving data from a datastore.
      Returns:
      boolean requireTrackedSCO flag
    • setRequireTrackedSCO

      void setRequireTrackedSCO(boolean flag)
      Sets the requireTrackedSCO flag for this PersistenceManagerFactory. If set to false, by default the PersistenceManager will not create tracked SCO instances for new persistent instances at commit with retainValues set to true and while retrieving data from a datastore.
      Parameters:
      flag - boolean requireTrackedSCO flag