|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Server
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 uses a single connection pool by default, but allows multiple connection pools and separate read/write pools to be configured. 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:
Server
,
ClientSession
,
UnitOfWork
Method Summary | |
---|---|
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(Login 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,
Login 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. |
ConnectionPool |
getReadConnectionPool()
PUBLIC: Handles allocating connections for read queries. |
void |
setDatasourceLogin(Login login)
PUBLIC: Set the login. |
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 |
setReadConnectionPool(ConnectionPool readConnectionPool)
PUBLIC: Sets the read connection pool directly. |
void |
useExclusiveReadConnectionPool(int minNumberOfConnections,
int maxNumberOfConnections)
PUBLIC: Sets the read connection pool to be a separate exclusive ConnectionPool
with the minimum and maximum number of connections. |
void |
useExclusiveReadConnectionPool(int initialNumberOfConnections,
int minNumberOfConnections,
int maxNumberOfConnections)
PUBLIC: Sets the read connection pool to be a separate exclusive ConnectionPool
with the initial, minimum and maximum number of connections. |
void |
useExternalReadConnectionPool()
PUBLIC: Sets the read connection pool to be an ExternalConnectionPool . |
void |
useReadConnectionPool(int minNumberOfConnections,
int maxNumberOfConnections)
PUBLIC: Sets the read connection pool to be a separate shared ConnectionPool
with the minimum and maximum number of connections. |
void |
useReadConnectionPool(int initialNumberOfConnections,
int minNumberOfConnections,
int maxNumberOfConnections)
PUBLIC: Sets the read connection pool to be a separate shared ConnectionPool
with the minimum and maximum number of connections. |
Methods inherited from interface org.eclipse.persistence.sessions.DatabaseSession |
---|
addDescriptor, addDescriptors, addDescriptors, beginTransaction, commitTransaction, deleteAllObjects, deleteObject, getCommandManager, getSequencingControl, getServerPlatform, insertObject, isInTransaction, login, login, login, logout, refreshAndLockObject, refreshAndLockObject, rollbackTransaction, setCommandManager, setExternalTransactionController, setLogin, setServerPlatform, setShouldPropagateChanges, shouldPropagateChanges, updateObject, writeAllObjects, writeObject |
Method Detail |
---|
ClientSession acquireClientSession() throws DatabaseException
DatabaseException
ClientSession acquireClientSession(java.lang.String poolName)
ClientSession acquireClientSession(Login login)
ClientSession acquireClientSession(ConnectionPolicy connectionPolicy)
void addConnectionPool(java.lang.String poolName, Login login, int minNumberOfConnections, int maxNumberOfConnections)
void addConnectionPool(ConnectionPool pool)
ConnectionPool getConnectionPool(java.lang.String poolName)
ConnectionPolicy getDefaultConnectionPolicy()
ConnectionPool getDefaultConnectionPool()
int getMaxNumberOfNonPooledConnections()
ConnectionPool getReadConnectionPool()
By default a read connection pool is not used, the default connection pool is used for reading.
The read connection pool is not used while in transaction.
setReadConnectionPool(ConnectionPool)
,
useExclusiveReadConnectionPool(int, int)
,
useExternalReadConnectionPool()
,
useReadConnectionPool(int, int)
void setDatasourceLogin(Login login)
setDatasourceLogin
in interface DatabaseSession
void setDefaultConnectionPolicy(ConnectionPolicy defaultConnectionPolicy)
void setMaxNumberOfNonPooledConnections(int maxNumberOfNonPooledConnections)
void setReadConnectionPool(ConnectionPool readConnectionPool)
Either useExclusiveReadConnectionPool(int, int)
or useExternalReadConnectionPool()
is
called in the constructor. For a connection pool using concurrent reading
useReadConnectionPool(int, int)
should be called on a new instance of this
.
ValidationException
- if already connectedvoid useExclusiveReadConnectionPool(int minNumberOfConnections, int maxNumberOfConnections)
ConnectionPool
with the minimum and maximum number of connections.
A separate read connection pool is not used by default, by default the default connection pool is used for reading. A separate read connection pool can be used to dedicate a pool of connections only for reading. It can also be used to use a non-JTA DataSource for reading to avoid JTA overhead, or to use a different user login for reading.
getReadConnectionPool()
,
setReadConnectionPool(ConnectionPool)
,
useReadConnectionPool(int, int)
,
useExternalReadConnectionPool()
void useExclusiveReadConnectionPool(int initialNumberOfConnections, int minNumberOfConnections, int maxNumberOfConnections)
ConnectionPool
with the initial, minimum and maximum number of connections.
A separate read connection pool is not used by default, by default the default connection pool is used for reading. A separate read connection pool can be used to dedicate a pool of connections only for reading. It can also be used to use a non-JTA DataSource for reading to avoid JTA overhead, or to use a different user login for reading.
getReadConnectionPool()
,
setReadConnectionPool(ConnectionPool)
,
useReadConnectionPool(int, int)
,
useExternalReadConnectionPool()
void useExternalReadConnectionPool()
ExternalConnectionPool
.
This type of connection pool will be created and configured automatically if an external connection pooling is used.
getReadConnectionPool()
,
setReadConnectionPool(ConnectionPool)
,
useReadConnectionPool(int, int)
,
useExclusiveReadConnectionPool(int, int)
void useReadConnectionPool(int minNumberOfConnections, int maxNumberOfConnections)
ConnectionPool
with the minimum and maximum number of connections.
A separate read connection pool is not used by default, by default the default connection pool is used for reading. A separate read connection pool can be used to dedicate a pool of connections only for reading. It can also be used to use a non-JTA DataSource for reading to avoid JTA overhead, or to use a different user login for reading.
Since read connections are not used for writing, multiple users can theoretically use the same connection at the same time. However some JDBC drivers do not allow this, or have poor concurrency when this is done.
Use this read connection pool to take advantage of concurrent reading.
minNumberOfConnections
- maxNumberOfConnections
- As multiple readers can use the same connection
concurrently fewer connections are needed.getReadConnectionPool()
,
setReadConnectionPool(ConnectionPool)
,
useExternalReadConnectionPool()
,
useExclusiveReadConnectionPool(int, int)
void useReadConnectionPool(int initialNumberOfConnections, int minNumberOfConnections, int maxNumberOfConnections)
ConnectionPool
with the minimum and maximum number of connections.
A separate read connection pool is not used by default, by default the default connection pool is used for reading. A separate read connection pool can be used to dedicate a pool of connections only for reading. It can also be used to use a non-JTA DataSource for reading to avoid JTA overhead, or to use a different user login for reading.
Since read connections are not used for writing, multiple users can theoretically use the same connection at the same time. However some JDBC drivers do not allow this, or have poor concurrency when this is done.
Use this read connection pool to take advantage of concurrent reading.
initialNumberOfConnections
- connections connected at startupminNumberOfConnections
- connections that are pooledmaxNumberOfConnections
- As multiple readers can use the same connection
concurrently fewer connections are needed.getReadConnectionPool()
,
setReadConnectionPool(ConnectionPool)
,
useExternalReadConnectionPool()
,
useExclusiveReadConnectionPool(int, int)
|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |