Class PersistenceManagerFactoryImpl

    • Constructor Detail

      • PersistenceManagerFactoryImpl

        public PersistenceManagerFactoryImpl()
        Creates new PersistenceManagerFactoryImpl without any user info
      • PersistenceManagerFactoryImpl

        public PersistenceManagerFactoryImpl​(String URL,
                                             String userName,
                                             char[] password,
                                             String driverName)
        Creates new PersistenceManagerFactoryImpl with user info
        Parameters:
        URL - connection URL
        userName - database user
        password - database user password
        driverName - driver name
    • Method Detail

      • setConnectionPassword

        public void setConnectionPassword​(char[] password)
        Sets database user password
        Specified by:
        setConnectionPassword in interface PersistenceManagerFactory
        Parameters:
        password - database user password
      • setIdentifier

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

        public String getIdentifier()
        Gets Identifier. An identifier is a string that user can use to identify the PersistenceManagerFactory in a given environment. Identifier can be particularly useful in an environment where multiple PersistenceManagerFactories are initialized in a system.
        Specified by:
        getIdentifier in interface PersistenceManagerFactory
        Returns:
        identifier
      • setConnectionMaxPool

        public void setConnectionMaxPool​(int MaxPool)
        Sets maximum number of connections in the connection pool
        Specified by:
        setConnectionMaxPool in interface PersistenceManagerFactory
        Parameters:
        MaxPool - maximum number of connections
      • setConnectionMinPool

        public void setConnectionMinPool​(int MinPool)
        Sets minimum number of connections in the connection pool
        Specified by:
        setConnectionMinPool in interface PersistenceManagerFactory
        Parameters:
        MinPool - minimum number of connections
      • setConnectionMsWait

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

        public int getConnectionMsWait()
        Returns the number of milliseconds to wait for an available connection from the connection pool before throwing an exception
        Specified by:
        getConnectionMsWait in interface PersistenceManagerFactory
        Returns:
        number in milliseconds
      • getMaxPool

        public int getMaxPool()
        Returns maximum number of PersistenceManager instances in the pool
        Specified by:
        getMaxPool in interface PersistenceManagerFactory
        Returns:
        maxPool
      • setMaxPool

        public void setMaxPool​(int MaxPool)
        Sets maximum number of PersistenceManager instances in the pool
        Specified by:
        setMaxPool in interface PersistenceManagerFactory
        Parameters:
        MaxPool - maximum number of PersistenceManager instances
      • getMinPool

        public int getMinPool()
        Returns minimum number of PersistenceManager instances in the pool
        Specified by:
        getMinPool in interface PersistenceManagerFactory
        Returns:
        minPool
      • setMinPool

        public void setMinPool​(int MinPool)
        Sets minimum number of PersistenceManager instances in the pool
        Specified by:
        setMinPool in interface PersistenceManagerFactory
        Parameters:
        MinPool - minimum number of PersistenceManager instances
      • setConnectionMsInterval

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

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

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

        public int getConnectionLoginTimeout()
        Returns the number of seconds to wait for a new connection to be established to the data source
        Specified by:
        getConnectionLoginTimeout in interface PersistenceManagerFactory
        Returns:
        wait time in seconds
      • setQueryTimeout

        public void setQueryTimeout​(String timeout)
        Sets the queryTimeout for all PersistenceManagers
        Parameters:
        timeout - the timout to be set
      • setQueryTimeout

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

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

        public void setUpdateTimeout​(String timeout)
        Sets the updateTimeout for all PersistenceManagers
        Parameters:
        timeout - the timout to be set
      • setUpdateTimeout

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

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

        public 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
        Specified by:
        setConnectionTransactionIsolation in interface PersistenceManagerFactory
        Parameters:
        level - - one of the java.sql.Connection.TRANSACTION_* isolation values
      • getConnectionTransactionIsolation

        public int getConnectionTransactionIsolation()
        Returns current transaction isolation level for connections of this PersistenceManagerFactory.
        Specified by:
        getConnectionTransactionIsolation in interface PersistenceManagerFactory
        Returns:
        the current transaction isolation mode value as java.sql.Connection.TRANSACTION_*
      • setOptimistic

        public void setOptimistic​(String flag)
        Sets the optimistic flag for all PersistenceManagers
        Parameters:
        flag - String optimistic flag
      • setOptimistic

        public void setOptimistic​(boolean flag)
        Sets the optimistic flag for all PersistenceManagers
        Specified by:
        setOptimistic in interface PersistenceManagerFactory
        Parameters:
        flag - boolean optimistic flag
      • getOptimistic

        public boolean getOptimistic()
        Returns the boolean value of the optimistic flag for all PersistenceManagers
        Specified by:
        getOptimistic in interface PersistenceManagerFactory
        Returns:
        boolean optimistic flag
      • setRetainValues

        public void setRetainValues​(String flag)
        Sets the RetainValues flag for all PersistenceManagers
        Parameters:
        flag - String RetainValues flag
      • setRetainValues

        public void setRetainValues​(boolean flag)
        Sets flag that will not cause the eviction of persistent instances after transaction completion.
        Specified by:
        setRetainValues in interface PersistenceManagerFactory
        Parameters:
        flag - boolean flag passed
      • getRetainValues

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

        public void setNontransactionalRead​(String flag)
        Sets the NontransactionalRead flag for all PersistenceManagers
        Parameters:
        flag - String NontransactionalRead flag
      • setNontransactionalRead

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

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

        public void setIgnoreCache​(String flag)
        Sets the IgnoreCache flag for all PersistenceManagers
        Parameters:
        flag - String IgnoreCache flag
      • setIgnoreCache

        public 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.
        Specified by:
        setIgnoreCache in interface PersistenceManagerFactory
        Parameters:
        flag - boolean flag passed
      • getIgnoreCache

        public 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.
        Specified by:
        getIgnoreCache in interface PersistenceManagerFactory
        Returns:
        boolean setting for the flag
      • getProperties

        public Properties getProperties()
        Returns non-operational properties to be available to the application via a Properties instance.
        Specified by:
        getProperties in interface PersistenceManagerFactory
        Returns:
        Properties object
      • getSupersedeDeletedInstance

        public 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.
        Specified by:
        getSupersedeDeletedInstance in interface PersistenceManagerFactory
        Returns:
        boolean supersedeDeletedInstance flag
      • setSupersedeDeletedInstance

        public void setSupersedeDeletedInstance​(boolean flag)
        Sets the supersedeDeletedInstance flag for all PersistenceManagers.
        Specified by:
        setSupersedeDeletedInstance in interface PersistenceManagerFactory
        Parameters:
        flag - boolean supersedeDeletedInstance flag
      • getRequireTrackedSCO

        public boolean getRequireTrackedSCO()
        Returns the boolean value of the requireTrackedSCO flag. 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.
        Specified by:
        getRequireTrackedSCO in interface PersistenceManagerFactory
        Returns:
        boolean requireTrackedSCO flag
      • setRequireTrackedSCO

        public 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.
        Specified by:
        setRequireTrackedSCO in interface PersistenceManagerFactory
        Parameters:
        flag - boolean requireTrackedSCO flag
      • setBooleanProperty

        public void setBooleanProperty​(String name,
                                       boolean value)
        Sets default value of a known boolean property.
        Parameters:
        name - the name of the property to be set.
        value - the default boolean value.
      • equals

        public boolean equals​(Object obj)
        Determines whether obj is a PersistenceManagerFactoryImpl with the same configuration
        Overrides:
        equals in class Object
        Parameters:
        obj - The possibly null object to check.
        Returns:
        true if obj is equal to this PersistenceManagerFactoryImpl; false otherwise.
      • hashCode

        public int hashCode()
        Computes the hash code of this PersistenceManagerFactory.
        Overrides:
        hashCode in class Object
        Returns:
        A hash code of the owning PersistenceManagerFactory as an int.