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
| Modifier and Type | Method and Description |
|---|---|
| public ClientSession | |
| public ClientSession | |
| public ClientSession | |
| public ClientSession | acquireClientSession(ConnectionPolicy connectionPolicy)
PUBLIC: Return a client session for this server session. |
| public void | addConnectionPool(String poolName, Login login, int minNumberOfConnections, int maxNumberOfConnections)
PUBLIC: Add the connection pool. |
| public void | addConnectionPool(ConnectionPool pool)
PUBLIC: Connection are pooled to share and restrict the number of database connections. |
| public ConnectionPool | |
| public ConnectionPolicy | getDefaultConnectionPolicy()
PUBLIC: The default connection policy is used by default by the acquireClientConnection() protocol. |
| public ConnectionPool | |
| public int | getMaxNumberOfNonPooledConnections()
PUBLIC: Return the number of non-pooled database connections allowed. |
| public ConnectionPool | |
| public void | setDatasourceLogin(Login login)
Redeclares org. |
| public void | setDefaultConnectionPolicy(ConnectionPolicy defaultConnectionPolicy)
PUBLIC: The default connection policy is used by default by the acquireClientConnection() protocol. |
| public void | setMaxNumberOfNonPooledConnections(int maxNumberOfNonPooledConnections)
PUBLIC: Set the number of non-pooled database connections allowed. |
| public void | setReadConnectionPool(ConnectionPool readConnectionPool)
PUBLIC: Sets the read connection pool directly. |
| public void | useExclusiveReadConnectionPool(int minNumberOfConnections, int maxNumberOfConnections)
PUBLIC:
Sets the read connection pool to be a separate exclusive |
| public void | useExclusiveReadConnectionPool(int initialNumberOfConnections, int minNumberOfConnections, int maxNumberOfConnections)
PUBLIC:
Sets the read connection pool to be a separate exclusive |
| public void | useExternalReadConnectionPool()
PUBLIC:
Sets the read connection pool to be an |
| public void | useReadConnectionPool(int minNumberOfConnections, int
As multiple readers can use the same connection
concurrently fewer connections are needed. maxNumberOfConnections)PUBLIC:
Sets the read connection pool to be a separate shared |
| public void | useReadConnectionPool(int
connections connected at startup initialNumberOfConnections, int connections that are pooled minNumberOfConnections, int As multiple readers can use the same connection
concurrently fewer connections are needed. maxNumberOfConnections)PUBLIC:
Sets the read connection pool to be a separate shared |
| acquireClientSession | back to summary |
|---|---|
| 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 | back to summary |
|---|---|
| public ClientSession acquireClientSession(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 | back to summary |
|---|---|
| public ClientSession acquireClientSession(Login 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 | back to summary |
|---|---|
| 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 | back to summary |
|---|---|
| public void addConnectionPool(String poolName, Login login, int minNumberOfConnections, int maxNumberOfConnections) PUBLIC: Add the connection pool. Connections are pooled to share and restrict the number of database connections. | |
| addConnectionPool | back to summary |
|---|---|
| public void addConnectionPool(ConnectionPool pool) PUBLIC: Connection are pooled to share and restrict the number of database connections. | |
| getConnectionPool | back to summary |
|---|---|
| public ConnectionPool getConnectionPool(String poolName) PUBLIC: Return the pool by name. | |
| getDefaultConnectionPolicy | back to summary |
|---|---|
| public ConnectionPolicy getDefaultConnectionPolicy() PUBLIC: The default connection policy is used by default by the acquireClientConnection() protocol. By default it uses the default connection pool. | |
| getDefaultConnectionPool | back to summary |
|---|---|
| public ConnectionPool getDefaultConnectionPool() PUBLIC: Return the default connection pool. | |
| getMaxNumberOfNonPooledConnections | back to summary |
|---|---|
| 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. | |
| getReadConnectionPool | back to summary |
|---|---|
| public ConnectionPool getReadConnectionPool() PUBLIC: Handles allocating connections for read queries. 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. | |
| setDatasourceLogin | back to summary |
|---|---|
| public void setDatasourceLogin(Login login) Redeclares org. PUBLIC: Set the login.
| |
| setDefaultConnectionPolicy | back to summary |
|---|---|
| public void setDefaultConnectionPolicy(ConnectionPolicy defaultConnectionPolicy) PUBLIC: The default connection policy is used by default by the acquireClientConnection() protocol. By default it uses the default connection pool. | |
| setMaxNumberOfNonPooledConnections | back to summary |
|---|---|
| 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. | |
| setReadConnectionPool | back to summary |
|---|---|
| public void setReadConnectionPool(ConnectionPool readConnectionPool) PUBLIC: Sets the read connection pool directly.
Either
| |
| useExclusiveReadConnectionPool | back to summary |
|---|---|
| public void useExclusiveReadConnectionPool(int minNumberOfConnections, int maxNumberOfConnections) PUBLIC:
Sets the read connection pool to be a separate exclusive 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. | |
| useExclusiveReadConnectionPool | back to summary |
|---|---|
| public void useExclusiveReadConnectionPool(int initialNumberOfConnections, int minNumberOfConnections, int maxNumberOfConnections) PUBLIC:
Sets the read connection pool to be a separate exclusive 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. | |
| useExternalReadConnectionPool | back to summary |
|---|---|
| public void useExternalReadConnectionPool() PUBLIC:
Sets the read connection pool to be an This type of connection pool will be created and configured automatically if an external connection pooling is used. | |
| useReadConnectionPool | back to summary |
|---|---|
| public void useReadConnectionPool(int minNumberOfConnections, int maxNumberOfConnections) PUBLIC:
Sets the read connection pool to be a separate shared
| |
| useReadConnectionPool | back to summary |
|---|---|
| public void useReadConnectionPool(int initialNumberOfConnections, int minNumberOfConnections, int maxNumberOfConnections) PUBLIC:
Sets the read connection pool to be a separate shared
| |