com.atomikos.jdbc
Class ConnectionPool

java.lang.Object
  extended by com.atomikos.jdbc.ConnectionPool
All Implemented Interfaces:
Runnable

Deprecated. As of release 3.3, the newer pool should be used instead.

public class ConnectionPool
extends Object
implements Runnable

A connection pooling implementation. This class is NOT meant to be used by the application directly. Rather, a DataSource object should wrap this class.


Constructor Summary
ConnectionPool(int size, ConnectionFactory connSource, int connectionTimeout, String testQuery, boolean testOnBorrow)
          Deprecated. Constructor.
 
Method Summary
 void cleanup()
          Deprecated. To be called when the pool of connections is no longer needed.
 void finalize()
          Deprecated.  
 int getLoginTimeout()
          Deprecated.  
 PrintWriter getLogWriter()
          Deprecated.  
protected  Enumeration getOldConnections()
          Deprecated.  
 PooledConnection getPooledConnection()
          Deprecated. Get a PooledConnection instance from the pool.
 int getSize()
          Deprecated. Get the current size of the available pool.
 void putBack(XPooledConnection conn)
          Deprecated. Puts back a connection after usage.
protected  void putInPool(PooledConnection pc)
          Deprecated.  
 void run()
          Deprecated.  
 void setLoginTimeout(int secs)
          Deprecated.  
 void setLogWriter(PrintWriter pw)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionPool

public ConnectionPool(int size,
                      ConnectionFactory connSource,
                      int connectionTimeout,
                      String testQuery,
                      boolean testOnBorrow)
               throws SQLException
Deprecated. 
Constructor.

Parameters:
size - The size of the pool.
connSource - The ConnectionFactory to use.
seconds - The timeout for old connections in the pool.
testQuery - A test query to validate connection liveness.
testOnBorrow - Should connections be tested when borrowed or not? If true then connections will be tested when gotten:
  • for a connection from the pool, a failing test will retry with another connection
  • for new connections (i.e. when pool is empty), a failing test will be thrown to the application
Throws:
SQLException
Method Detail

getSize

public int getSize()
Deprecated. 
Get the current size of the available pool.

Returns:
int The current size. Does NOT include connections that are currently being used!

getPooledConnection

public PooledConnection getPooledConnection()
                                     throws SQLException
Deprecated. 
Get a PooledConnection instance from the pool.

Returns:
PooledConnection The instance.
Throws:
SQLException - On error.

putInPool

protected void putInPool(PooledConnection pc)
Deprecated. 

putBack

public void putBack(XPooledConnection conn)
Deprecated. 
Puts back a connection after usage. This method should be called by DataSource objects.

Parameters:
conn - The connection. If the connection has been invalidated, or if the pool is large enough, then this method will actually close the connection.

getOldConnections

protected Enumeration getOldConnections()
Deprecated. 

run

public void run()
Deprecated. 
Specified by:
run in interface Runnable

cleanup

public void cleanup()
Deprecated. 
To be called when the pool of connections is no longer needed. This method will close all connections in the pool.


finalize

public void finalize()
              throws Throwable
Deprecated. 
Overrides:
finalize in class Object
Throws:
Throwable

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Deprecated. 
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter pw)
                  throws SQLException
Deprecated. 
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int secs)
                     throws SQLException
Deprecated. 
Throws:
SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Deprecated. 
Throws:
SQLException


Copyright © 2011. All Rights Reserved.