org.geotools.arcsde.pool
Class ArcSDEConnectionReference

Object
  extended by SessionPool
      extended by ArcSDEConnectionReference

public class ArcSDEConnectionReference
extends SessionPool

This SessionPool makes a maximum of *one* Connection available to the calling application.

Why? ArcSDEConnections are both expensive to set up and expensive in cache. We still use an ObjectCache internally in order to control time out behavior.

The trick is this time that Transaction.AUTO_COMMIT is only treated as suggestion for read only code. The system will allow one transaction to be underway at any point, and will hand out that connection to code that knows how to ask.

This is an aggressive experiment designed to cut down the number of connections needed.

Since:
2.5
Author:
Jody Garnett

Nested Class Summary
 
Nested classes/interfaces inherited from class SessionPool
SessionPool.SeConnectionFactory
 
Field Summary
 
Fields inherited from class SessionPool
config, DEFAULT_CONNECTIONS, DEFAULT_MAX_CONNECTIONS, DEFAULT_MAX_WAIT_TIME, INFO_LOG_LEVEL, pool
 
Constructor Summary
protected ArcSDEConnectionReference(ArcSDEConnectionConfig config)
           
 
Method Summary
 ISession getSession()
          Grab a session from the pool, this session is the responsibility of the calling code and must be closed after use.
 
Methods inherited from class SessionPool
close, createConnectionFactory, finalize, getAvailableCount, getAvailableLayerNames, getConfig, getInUseCount, getPoolSize, getSession, isClosed, toString
 
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArcSDEConnectionReference

protected ArcSDEConnectionReference(ArcSDEConnectionConfig config)
                             throws IOException
Throws:
IOException
Method Detail

getSession

public ISession getSession()
                    throws DataSourceException,
                           UnavailableArcSDEConnectionException
Description copied from class: SessionPool
Grab a session from the pool, this session is the responsibility of the calling code and must be closed after use.

Overrides:
getSession in class SessionPool
Returns:
A Session, when close() is called it will be recycled into the pool
Throws:
DataSourceException - If we could not get a connection
UnavailableArcSDEConnectionException - If we are out of connections


Copyright © 1996-2009 Geotools. All Rights Reserved.