oracle.toplink.threetier
Interface Server

All Superinterfaces:
DatabaseSession, Session
All Known Implementing Classes:
ServerSession

public interface Server
extends DatabaseSession

Purpose: A single session that supports multiple user/clients connection at the same time.

Description: This session supports a shared session that can be used by multiple users or clients in a three-tiered application. It brokers client sessions to allow read and write access through a unified object cache. The server session provides a shared read only database connection that is used by all of its client for reads. All changes to objects and the database must be done through a unit of work acquired from the client session, this allows the changes to occur in a transactional object space and under a exclusive database connection.

Responsibilities:

See Also:

Method Summary
TypeMethod
 ClientSession acquireClientSession()
          PUBLIC: Return a client session for this server session.
 ClientSession acquireClientSession(ConnectionPolicy connectionPolicy)
          PUBLIC: Return a client session for this server session.
 ClientSession acquireClientSession(DatabaseLogin login)
          PUBLIC: Return a client session for this server session.
 ClientSession acquireClientSession(java.lang.String poolName)
          PUBLIC: Return a client session for this server session.
 void addConnectionPool(ConnectionPool pool)
          PUBLIC: Connection are pooled to share and restrict the number of database connections.
 void addConnectionPool(java.lang.String poolName, DatabaseLogin login, int minNumberOfConnections, int maxNumberOfConnections)
          PUBLIC: Add the connection pool.
 ConnectionPool getConnectionPool(java.lang.String poolName)
          PUBLIC: Return the pool by name.
 ConnectionPolicy getDefaultConnectionPolicy()
          PUBLIC: The default connection policy is used by default by the acquireClientConnection() protocol.
 ConnectionPool getDefaultConnectionPool()
          PUBLIC: Return the default connection pool.
 int getMaxNumberOfNonPooledConnections()
          PUBLIC: Return the number of non-pooled database connections allowed.
 int getNumberOfReadConnections()
          Deprecated.  
 ConnectionPool getReadConnectionPool()
          PUBLIC: Return the read connection pool.
 void setDefaultConnectionPolicy(ConnectionPolicy defaultConnectionPolicy)
          PUBLIC: The default connection policy is used by default by the acquireClientConnection() protocol.
 void setMaxNumberOfNonPooledConnections(int maxNumberOfNonPooledConnections)
          PUBLIC: Set the number of non-pooled database connections allowed.
 void setNumberOfReadConnections(int numberOfReadConnections)
          Deprecated.  
 void setReadConnectionPool(ConnectionPool readConnectionPool)
          PUBLIC: Set the read connection pool.
 void useExclusiveReadConnectionPool(int minNumerOfConnections, int maxNumerOfConnections)
          PUBLIC: Configure the read connection pool.
 void useExternalReadConnectionPool()
          PUBLIC: Configure the read connection pool.
 void useReadConnectionPool(int minNumerOfConnections, int maxNumerOfConnections)
          PUBLIC: Configure the read connection pool.
 
Methods inherited from interface oracle.toplink.sessions.DatabaseSession
addDescriptor, addDescriptors, addDescriptors, beginTransaction, commitTransaction, deleteAllObjects, deleteAllObjects, deleteObject, insertObject, isInTransaction, login, login, login, logout, refreshAndLockObject, refreshAndLockObject, rollbackTransaction, setExternalTransactionController, setLogin, updateObject, writeAllObjects, writeAllObjects, writeObject
 
Methods inherited from interface oracle.toplink.sessions.Session
acquireUnitOfWork, addQuery, clearIntegrityChecker, clearProfile, containsObjectInIdentityMap, containsObjectInIdentityMap, containsQuery, copyObject, copyObject, doesObjectExist, dontLogMessages, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, getActiveSession, getActiveUnitOfWork, getAllFromIdentityMap, getAllFromIdentityMap, getCacheSynchronizationManager, getDescriptor, getDescriptor, getDescriptors, getEventManager, getExceptionHandler, getExternalTransactionController, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getFromIdentityMap, getIntegrityChecker, getLog, getLogin, getName, getNextSequenceNumberValue, getProfiler, getProject, getProperties, getProperty, getQueries, getQuery, getSessionLog, getWriteLockValue, getWriteLockValue, handleException, hasCacheSynchronizationManager, hasDescriptor, hasExceptionHandler, hasExternalTransactionController, initializeAllIdentityMaps, initializeIdentityMap, initializeIdentityMaps, isClientSession, isConnected, isDatabaseSession, isDistributedSession, isInProfile, isProxySession, isRemoteSession, isServerSession, isSessionBroker, isUnitOfWork, keyFromObject, log, logDebug, logException, logMessage, logMessages, printIdentityMap, printIdentityMaps, putInIdentityMap, putInIdentityMap, putInIdentityMap, readAllObjects, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, readObject, refreshObject, release, removeFromIdentityMap, removeFromIdentityMap, removeProperty, removeQuery, setCacheSynchronizationManager, setExceptionHandler, setIntegrityChecker, setLog, setName, setProfiler, setProperty, setSessionLog, setShouldLogMessages, shouldLogMessages, updateWriteLockValue, updateWriteLockValue, usesExternalTransactionController, validateCache
 

Method Detail

acquireClientSession

public ClientSession acquireClientSession()
                                   throws DatabaseException
PUBLIC: Return a client session for this server session. Each user/client connected to this server session must acquire there own client session to communicate to the server through. This method allows for a client session to be acquired sharing the same login as the server session.

acquireClientSession

public ClientSession acquireClientSession(java.lang.String poolName)
PUBLIC: Return a client session for this server session. Each user/client connected to this server session must acquire there own client session to communicate to the server through. This method allows for a client session to be acquired sharing its connection from a pool of connection allocated on the server session. By default this uses a lazy connection policy.

acquireClientSession

public ClientSession acquireClientSession(DatabaseLogin login)
PUBLIC: Return a client session for this server session. Each user/client connected to this server session must acquire there own client session to communicate to the server through. The client must provide its own login to use, and the client session returned will have its own exclusive database connection. This connection will be used to perform all database modification for all units of work acquired from the client session. By default this does not use a lazy connection policy.

acquireClientSession

public ClientSession acquireClientSession(ConnectionPolicy connectionPolicy)
PUBLIC: Return a client session for this server session. The connection policy specifies how the client session's connection will be acquired.

addConnectionPool

public void addConnectionPool(java.lang.String poolName,
                              DatabaseLogin login,
                              int minNumberOfConnections,
                              int maxNumberOfConnections)
PUBLIC: Add the connection pool. Connections are pooled to share and restrict the number of database connections.

addConnectionPool

public void addConnectionPool(ConnectionPool pool)
PUBLIC: Connection are pooled to share and restrict the number of database connections.

getConnectionPool

public ConnectionPool getConnectionPool(java.lang.String poolName)
PUBLIC: Return the pool by name.

getDefaultConnectionPolicy

public ConnectionPolicy getDefaultConnectionPolicy()
PUBLIC: The default connection policy is used by default by the acquireClientConnection() protocol. By default it is a connection pool with min 5 and max 10 lazy pooled connections.

getDefaultConnectionPool

public ConnectionPool getDefaultConnectionPool()
PUBLIC: Return the default connection pool.

getMaxNumberOfNonPooledConnections

public int getMaxNumberOfNonPooledConnections()
PUBLIC: Return the number of non-pooled database connections allowed. This can be enforced to make up for the resource limitation of most JDBC drivers and database clients. By default this is 50.

getNumberOfReadConnections

public int getNumberOfReadConnections()
Deprecated.  

OBSOLETE: A read connection pool has be added to ecapsulate read connection pooling.

getReadConnectionPool

public ConnectionPool getReadConnectionPool()
PUBLIC: Return the read connection pool. The read connection pool handles allocating connection for read queries. By default a ReadConnnectionPool with a single connection. This is normally sufficient as a JDBC connection can support concurrent reading. Multiple connections can also be specified and may improve concurrency on some JDBC drivers/databases. If external connection pooling is used, an external connection pool will be used by default. If your JDBC driver does not support concurrency corrently a normal ConnectionPool can be used to ensure exclusive access to the read connection, note that this will give less concurrency.

setDefaultConnectionPolicy

public void setDefaultConnectionPolicy(ConnectionPolicy defaultConnectionPolicy)
PUBLIC: The default connection policy is used by default by the acquireClientConnection() protocol. By default it is a connection pool with min 5 and max 10 lazy pooled connections.

setMaxNumberOfNonPooledConnections

public void setMaxNumberOfNonPooledConnections(int maxNumberOfNonPooledConnections)
PUBLIC: Set the number of non-pooled database connections allowed. This can be enforced to make up for the resource limitation of most JDBC drivers and database clients. By default this is 50.

setNumberOfReadConnections

public void setNumberOfReadConnections(int numberOfReadConnections)
Deprecated.  

OBSOLETE: A read connection pool has be added to ecapsulate read connection pooling.

setReadConnectionPool

public void setReadConnectionPool(ConnectionPool readConnectionPool)
PUBLIC: Set the read connection pool. The read connection pool handles allocating connection for read queries. By default a ReadConnnectionPool with a single connection. This is normally sufficient as a JDBC connection can support concurrent reading. Multiple connections can also be specified and may improve concurrency on some JDBC drivers/databases. If external connection pooling is used, an external connection pool will be used by default. If your JDBC driver does not support concurrency corrently a normal ConnectionPool can be used to ensure exclusive access to the read connection, note that this will give less concurrency.

useExclusiveReadConnectionPool

public void useExclusiveReadConnectionPool(int minNumerOfConnections,
                                           int maxNumerOfConnections)
PUBLIC: Configure the read connection pool. The read connection pool handles allocating connection for read queries. By default a ReadConnnectionPool with a single connection. This is normally sufficient as a JDBC connection can support concurrent reading. Multiple connections can also be specified and may improve concurrency on some JDBC drivers/databases. If external connection pooling is used, an external connection pool will be used by default. If your JDBC driver does not support concurrency corrently a normal ConnectionPool can be used to ensure exclusive access to the read connection, note that this will give less concurrency.

useExternalReadConnectionPool

public void useExternalReadConnectionPool()
PUBLIC: Configure the read connection pool. The read connection pool handles allocating connection for read queries. By default a ReadConnnectionPool with a single connection. This is normally sufficient as a JDBC connection can support concurrent reading. Multiple connections can also be specified and may improve concurrency on some JDBC drivers/databases. If external connection pooling is used, an external connection pool will be used by default. If your JDBC driver does not support concurrency corrently a normal ConnectionPool can be used to ensure exclusive access to the read connection, note that this will give less concurrency.

useReadConnectionPool

public void useReadConnectionPool(int minNumerOfConnections,
                                  int maxNumerOfConnections)
PUBLIC: Configure the read connection pool. The read connection pool handles allocating connection for read queries. By default a ReadConnnectionPool with a single connection. This is normally sufficient as a JDBC connection can support concurrent reading. Multiple connections can also be specified and may improve concurrency on some JDBC drivers/databases. If external connection pooling is used, an external connection pool will be used by default. If your JDBC driver does not support concurrency corrently a normal ConnectionPool can be used to ensure exclusive access to the read connection, note that this will give less concurrency.