SilverStream
Application Server 3.5

com.sssw.srv.api
Interface AgiDatabaseConnection

All Known Subinterfaces:
AgiDatabase

public interface AgiDatabaseConnection

This interface handles exported databases.


Method Summary
 Connection getConnection(boolean doWait)
          Get the next available JDBC (database) Connection object.
 int getConnectionCount()
          Return the number of connections managed by this Connection Pool Manager.
 int getUnallocatedConnectionCount()
          Get the number of connections that are unallocated in the Connection Pool at the time of this method call.
 void releaseConnection(Connection connection)
          Release the specified database connection back to the pool.
 

Method Detail

getConnectionCount

public int getConnectionCount()
Return the number of connections managed by this Connection Pool Manager.

getUnallocatedConnectionCount

public int getUnallocatedConnectionCount()
Get the number of connections that are unallocated in the Connection Pool at the time of this method call.
Returns:
number of currently available connections.

getConnection

public Connection getConnection(boolean doWait)
Get the next available JDBC (database) Connection object. If no Connections are available, the doWait parameter specifies the action to take. If doWait is true, then the call will pend and wait for a Connection. If doWait is false, the call will immediately return with a null reference. Returns the database connection object or null if one is not available.
Parameters:
doWait - true will pend until a Connection is available, false will return with or without a Connection.
Returns:
the database connection object or null if one is not available.
Usage:

The Connection is managed by an underlying Connection Pool Manager. Once a Connection is allocated, it is not reused until it is released back to the pool. The system will deadlock due to lack of Connection resources if Connections are allocated and not released. Always return the Connection object back to the pool with the releaseConnection() method.

See Also:
AgiDatabaseConnection.releaseConnection( Connection connection )

releaseConnection

public void releaseConnection(Connection connection)
Release the specified database connection back to the pool.
Parameters:
connection - database connection to be returned to pool.
Throws:
RuntimeException - if connection was not allocated by the connection pool

SilverStream
Application Server 3.5