FileDocCategorySizeDatePackage
DatabaseSessionConnectionHandler.javaAPI DocGlassfish v2 API3560Tue May 22 16:54:42 BST 2007oracle.toplink.essentials.internal.sequencing

DatabaseSessionConnectionHandler

public class DatabaseSessionConnectionHandler extends Object implements SequencingConnectionHandler

Fields Summary
DatabaseSessionImpl
ownerSession
Login
login
Accessor
accessor
boolean
isBusy
Constructors Summary
DatabaseSessionConnectionHandler(DatabaseSessionImpl ownerSession, Login login)

        this.ownerSession = ownerSession;
        this.login = login;
        accessor = login.buildAccessor();
    
Methods Summary
public synchronized oracle.toplink.essentials.internal.databaseaccess.AccessoracquireAccessor()

        if (isBusy) {
            try {
                wait();// Notify is called when connection is released.
            } catch (InterruptedException exception) {
                throw ConcurrencyException.waitFailureOnSequencingForDatabaseSession(exception);
            }
        }
        isBusy = true;
        return accessor;
    
protected voidfinalize()

        onDisconnect();
    
public booleanisConnected()

        return accessor.isConnected();
    
public voidonConnect()

        if (!isConnected()) {
            accessor.connect(login, ownerSession);
        }
    
public voidonDisconnect()

        if (isConnected()) {
            accessor.disconnect(ownerSession);
        }
    
public synchronized voidreleaseAccessor(oracle.toplink.essentials.internal.databaseaccess.Accessor accessor)

        isBusy = false;
        notify();