org.geotools.data.jdbc
Class JDBCTransactionState

java.lang.Object
  extended byorg.geotools.data.jdbc.JDBCTransactionState
All Implemented Interfaces:
Transaction.State
Direct Known Subclasses:
HsqlTransactionStateDiff

public class JDBCTransactionState
extends java.lang.Object
implements Transaction.State

Holds a JDBC Connectino for JDBCDataStore.

An alternative woudl be to hold the connection pool in the Transaction State and only construct a connection when setTransaction is called.

Author:
Jody Garnett, Refractions Research

Constructor Summary
JDBCTransactionState(java.sql.Connection connection)
           
JDBCTransactionState(ConnectionPool pool)
           
 
Method Summary
 void addAuthorization(java.lang.String AuthID)
          Not used by JDBCTransactionState Postgis will need to override this method to use strong transaction support.
 void commit()
          Commit the maintained state.
 java.sql.Connection getConnection()
          Retrive connection for JDBC opperation.
 void rollback()
          Rollback state of Transacstion.
 void setTransaction(Transaction transaction)
          Closes internal connection returns it to the ConnectionPool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCTransactionState

public JDBCTransactionState(java.sql.Connection connection)
                     throws java.io.IOException

JDBCTransactionState

public JDBCTransactionState(ConnectionPool pool)
                     throws java.io.IOException
Method Detail

getConnection

public java.sql.Connection getConnection()
Retrive connection for JDBC opperation.

This connection may be used to issue JDBC opperations against this transaction.

Please do not use:


setTransaction

public void setTransaction(Transaction transaction)
Closes internal connection returns it to the ConnectionPool.

Specified by:
setTransaction in interface Transaction.State
Parameters:
transaction -
See Also:
Transaction.State.setTransaction(org.geotools.data.Transaction)

addAuthorization

public void addAuthorization(java.lang.String AuthID)
                      throws java.io.IOException
Not used by JDBCTransactionState

Postgis will need to override this method to use strong transaction support.

Specified by:
addAuthorization in interface Transaction.State
Parameters:
AuthID -
Throws:
java.io.IOException
See Also:
Transaction.State.addAuthorization(java.lang.String)

commit

public void commit()
            throws java.io.IOException
Commit the maintained state.

JDBCTransactionState offers native support for this opperation

Specified by:
commit in interface Transaction.State
Throws:
java.io.IOException
See Also:
Transaction.State.commit()

rollback

public void rollback()
              throws java.io.IOException
Rollback state of Transacstion.

JDBCTransactionState offers native support for this opperation

Specified by:
rollback in interface Transaction.State
Throws:
java.io.IOException
See Also:
Transaction.State.rollback()


Copyright © GeoTools. All Rights Reserved.