Esri Geoportal Server
1.0

com.esri.gpt.framework.sql
Class ManagedConnections

java.lang.Object
  extended by com.esri.gpt.framework.sql.ManagedConnections

public final class ManagedConnections
extends Object

ManagedConnection collection.

The collection map is keyed on the name of the DatabaseReference associated with the connection (one connection per name).

This class is intended for use by a single execution thread.


Constructor Summary
protected ManagedConnections()
          Default constructor.
 
Method Summary
protected  void closeAll()
          Closes all ManagedConnections.
protected  void closeConnection(ManagedConnection managedConnection)
          Closed a ManagedConnection.
protected  void commitAll()
          Executes a commit for each ManagedConnection.
protected  ManagedConnection findByReferenceName(String referenceName)
          Finds the ManagedConnection associated with a DatabaseReference name.
protected  ManagedConnection returnConnection(DatabaseReference databaseReference)
          Returns the ManagedConnection associated with a supplied DatabaseReference.
protected  void rollbackAll()
          Executes a rollback for each ManagedConnection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedConnections

protected ManagedConnections()
Default constructor.

Method Detail

closeAll

protected void closeAll()
Closes all ManagedConnections.
The underlying JDBC connections are closed.


closeConnection

protected void closeConnection(ManagedConnection managedConnection)
Closed a ManagedConnection.
The underlying JDBC connection is closed.

Parameters:
managedConnection - the ManagedConnection to close

commitAll

protected void commitAll()
                  throws SQLException
Executes a commit for each ManagedConnection.

Throws:
SQLException - if an exception occurs

findByReferenceName

protected ManagedConnection findByReferenceName(String referenceName)
Finds the ManagedConnection associated with a DatabaseReference name.

Parameters:
referenceName - the DatabaseReference name associated with the ManagedConnection to find
Returns:
the associated ManagedConnection (null if none)

returnConnection

protected ManagedConnection returnConnection(DatabaseReference databaseReference)
                                      throws ClassNotFoundException,
                                             NamingException,
                                             SQLException
Returns the ManagedConnection associated with a supplied DatabaseReference.

If a ManagedConnection has already been established for the reference, it will be returned. Otherwise an new ManagedConnection will be established based upon the supplied DatabaseReference.

Parameters:
databaseReference - the associated DatabaseReference
Returns:
the ManagedConnection
Throws:
ClassNotFoundException - if the database driver class was not found
NamingException - if a JNDI naming exception occurs
SQLException - if an SQL exception occurs while establishing the connection

rollbackAll

protected void rollbackAll()
Executes a rollback for each ManagedConnection.


Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.