Class ConnectionFactoryImpl

  • All Implemented Interfaces:
    org.datanucleus.store.connection.ConnectionFactory

    public class ConnectionFactoryImpl
    extends org.datanucleus.store.connection.AbstractConnectionFactory
    ConnectionFactory for RDBMS datastores. Each instance is a factory of transactional or non-transactional connections, obtained through a javax.sql.DataSource.
    • Field Summary

      • Fields inherited from class org.datanucleus.store.connection.AbstractConnectionFactory

        RESOURCE_NAME_NONTX, RESOURCE_NAME_TX, resourceName, resourceType, storeMgr
      • Fields inherited from interface org.datanucleus.store.connection.ConnectionFactory

        DATANUCLEUS_CONNECTION_RESOURCE_TYPE, DATANUCLEUS_CONNECTION2_RESOURCE_TYPE
    • Constructor Summary

      Constructors 
      Constructor Description
      ConnectionFactoryImpl​(org.datanucleus.store.StoreManager storeMgr, String resourceName)
      Constructor.
    • Constructor Detail

      • ConnectionFactoryImpl

        public ConnectionFactoryImpl​(org.datanucleus.store.StoreManager storeMgr,
                                     String resourceName)
        Constructor.
        Parameters:
        storeMgr - Store Manager
        resourceName - either tx or nontx
    • Method Detail

      • close

        public void close()
        Specified by:
        close in interface org.datanucleus.store.connection.ConnectionFactory
        Overrides:
        close in class org.datanucleus.store.connection.AbstractConnectionFactory
      • initialiseDataSource

        protected void initialiseDataSource()
        Method to initialise the DataSource used by this ConnectionFactory. Only invoked when the request for the first connection comes in.
      • createManagedConnection

        public org.datanucleus.store.connection.ManagedConnection createManagedConnection​(org.datanucleus.ExecutionContext ec,
                                                                                          Map options)
        Method to create a new ManagedConnection.
        Parameters:
        ec - the object that is bound the connection during its lifecycle (if for a PM/EM operation)
        options - Options for creating the connection (optional)
        Returns:
        The ManagedConnection