org.geotools.arcsde.pool
Class ArcSDEConnectionReference
Object
SessionPool
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
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 |
ArcSDEConnectionReference
protected ArcSDEConnectionReference(ArcSDEConnectionConfig config)
throws IOException
- Throws:
IOException
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.