All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class bea.jolt.pool.SessionPool

java.lang.Object
   |
   +----bea.jolt.pool.Factory
           |
           +----bea.jolt.pool.SessionPool

public class SessionPool
extends Factory
This class represents a session pool that contains one or more connections (sessions) to a BEA TUXEDO system. Service requests are sent to the BEA TUXEDO system via the session pool that distributes requests across its available connections.

This class provides several methods that are part of the session pool administrative API. When using session pools with BEA WebLogic, administration is done via the BEA WebLogic console. A user does not need to access this administrative API directly.

The call and startTransaction methods are not part of the administrative API. They are used to submit requests to a BEA TUXEDO system.

Multiple service requests can be executed in a single transaction. When a transaction starts, the session pool picks the least busy connection and puts it in transactional mode. All service requests associated with that transaction are then sent via the selected connection. The connection associated with the transaction is not available for other requests until the transaction either commits or aborts. The transaction should commit or abort before a response is sent to the client, otherwise the connection does not return to the pool of available connections.

A session pool attempts to reestablish failed connections. When a connection fails, in-process transactions and requests fail and return errors. The session pool only reestablishes connections, it does not resubmit failed requests.

Refer to the BEA WebLogic Administrators Guide for information on configuring a session pool.

Author:
Copyright (c) 1999 by BEA Systems, Inc. All Rights Reserved.

Method Index

 o call(String, DataSet, Transaction)
Invokes a BEA TUXEDO service.
 o getConnection(int)
This method is part of the session pool administrative API.
 o getMaxConnections()
This method is part of the session pool administrative API.
 o isSuspended()
This method is part of the session pool administrative API.
 o setMaxConnections(int)
This method is part of the session pool administrative API.
 o startTransaction(int)
Starts a transaction.

Methods

 o call
 public Result call(String svcname,
                    DataSet input,
                    Transaction tran) throws SessionPoolException, ApplicationException, ServiceException, TransactionException
Invokes a BEA TUXEDO service. The name of the service to be invoked is passed to this method as a String svcname. Input parameters for the service are passed in input. If no input parameters are required for the service, input should be null. The names of the elements in the input must match the names of the service parameters.

To invoke multiple services in a transaction, create a Transaction object (see startTransaction()) and pass the Transaction object as the parameter tran. If this service is not part of a transaction tran should be null.

If the session pool is suspended or if no connections are available, this method throws a SessionPoolException.

Parameters:
svcname - Name of the service to be invoked
input - DataSet containing service parameters, or null if no input parameters
tran - Transaction object, or null if no transaction
Returns:
Result object, or null
Throws: SessionPoolException
No connections are available.
Throws: ApplicationException
An application error occurred.
Throws: ServiceException
A system error occurred.
Throws: TransactionException
A transaction error occurred.
See Also:
call, call, startTransaction
 o startTransaction
 public Transaction startTransaction(int timeout) throws SessionPoolException, TransactionException
Starts a transaction. The transaction starts on one of the connections in the session pool. Once a transaction starts on a connection, that connection cannot service requests other than those associated with the started transaction. The transaction must end (commit, abort or timeout) before the connection returns to the pool of available connections. The transaction timeout value is specified in seconds.

Parameters:
timeout - Transaction time-out value in seconds
Returns:
Transaction object
Throws: SessionPoolException
No connections are available.
Throws: TransactionException
A transaction error occurred.
See Also:
call, call
 o setMaxConnections
 public int setMaxConnections(int maxCons)
This method is part of the session pool administrative API. It changes the maximum number of connections for a session pool. The number of connections in a session pool can only be increased using this method; shrinking the session pool is not allowed. This method returns -1 if the caller attempts to shrink the pool size.

Parameters:
maxCons - New session pool size
Returns:
New spool size, or -1 for errors
 o getMaxConnections
 public int getMaxConnections()
This method is part of the session pool administrative API. It returns the maximum number of connections configured in this session pool. The actual number of established connections might be less than the maximum number configured, since connections are created dynamically depending on load.

Returns:
Configured maximum number of connections
 o isSuspended
 public boolean isSuspended()
This method is part of the session pool administrative API. It checks if this session pool is suspended. A suspended session pool does not accept any new requests.

Returns:
true if the session pool is suspended; otherwise, false
See Also:
suspendSessionPool
 o getConnection
 public Connection getConnection(int index)
This method is part of the session pool administrative API. It returns the connection at index from the session pool. The parameter index must be between zero and maxCons-1 as specified in bea.jolt.pool.SessionPoolManager.createSessionPool.

Parameters:
index - A connection index
Returns:
A Connection object.

All Packages  Class Hierarchy  This Package  Previous  Next  Index