FileDocCategorySizeDatePackage
ExternalConnectionPool.javaAPI DocGlassfish v2 API5023Tue May 22 16:54:54 BST 2007oracle.toplink.essentials.threetier

ExternalConnectionPool

public class ExternalConnectionPool extends ConnectionPool

Purpose: This subclass is intended to be used with external connection pools. For these pools, TopLink does not control the pooling behaviour. The login should have the usesExternalConnectionPooling set to "true".

Fields Summary
protected Accessor
cachedConnection
Constructors Summary
public ExternalConnectionPool()
PUBLIC: Build a new external connection pool. The JDBC driver is responsible for pooling the connections.

        super();
    
public ExternalConnectionPool(String name, Login login, ServerSession owner)
PUBLIC: Build a new external connection pool. The JDBC driver is responsible for pooling the connections.

        super(name, login, 0, 0, owner);
    
Methods Summary
public synchronized oracle.toplink.essentials.internal.databaseaccess.AccessoracquireConnection()
INTERNAL: When we acquire a connection from an ExternalConnectionPool we build a new connection (retrieve it from the external pool).

        return (Accessor)getCachedConnection().clone();
    
protected oracle.toplink.essentials.internal.databaseaccess.AccessorgetCachedConnection()
INTERNAL: Return the currently cached connection to the external connection pool

return
oracle.toplink.essentials.internal.databaseaccess.Accessor

        return cachedConnection;
    
public booleanhasConnectionAvailable()
INTERNAL: Assume true as the driver is responsible for blocking.

        return true;
    
public booleanisThereConflictBetweenLoginAndType()
INTERNAL: Checks for a conflict between pool's type and pool's login

        return !getLogin().shouldUseExternalConnectionPooling();
    
public synchronized voidreleaseConnection(oracle.toplink.essentials.internal.databaseaccess.Accessor connection)
INTERNAL: When you release an external connection, you simply let it go.

        getConnectionsUsed().removeElement(connection);
        connection.closeConnection();
        notify();
    
protected voidsetCachedConnection(oracle.toplink.essentials.internal.databaseaccess.Accessor cachedConnection)
Set the currently cached connection to the external connection pool.

param
oracle.toplink.essentials.internal.databaseaccess.Accessor

        this.cachedConnection = cachedConnection;
    
public synchronized voidshutDown()
INTERNAL: This mehtod is a no-op for external pools.

        //do nothing
        setIsConnected(false);
    
public synchronized voidstartUp()
INTERNAL: Build the default connection. This validates that connect will work and sets up the parent accessor to clone.

        setCachedConnection(buildConnection());
        setIsConnected(true);