Class SQLPersistenceManagerFactory

    • Constructor Detail

      • SQLPersistenceManagerFactory

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

        public SQLPersistenceManagerFactory​(Object connectionFactory)
        Creates new SQLPersistenceManagerFactory with user info
        Parameters:
        connectionFactory - Connection Factory as java.lang.Object
      • SQLPersistenceManagerFactory

        public SQLPersistenceManagerFactory​(PersistenceManagerFactory persistenceManagerFactory)
        Creates new SQLPersistenceManagerFactory with user parameters
        Parameters:
        persistenceManagerFactory - PersistenceManagerFactory instance
    • Method Detail

      • 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​(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​(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​(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
      • 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
      • 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
      • 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
      • 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_*
      • 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
      • 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
      • 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 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:
        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 requests and while retrieving data from a datastore.
        Specified by:
        setRequireTrackedSCO in interface PersistenceManagerFactory
        Parameters:
        flag - boolean requireTrackedSCO 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
      • getPersistenceManagerFactory

        public PersistenceManagerFactory getPersistenceManagerFactory()
        Returns instance of PersistenceManagerFactory
      • registerPersistenceManager

        public void registerPersistenceManager​(PersistenceManager pm,
                                               jakarta.transaction.Transaction t)
        Registers PersistenceManager in the transactional cache in managed environment in case of BMT with JDO Transaction. There is no jakarta.transaction.Transaction available before the user starts the transaction.
        Specified by:
        registerPersistenceManager in interface PersistenceManagerFactory
      • equals

        public boolean equals​(Object obj)
        Determines whether obj is a SQLPersistenceManagerFactory 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 SQLPersistenceManagerFactory; 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.