Esri Geoportal Server
1.0

com.esri.gpt.framework.sql
Class TransactionCounter

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

public final class TransactionCounter
extends Object

Manages the transaction count for a multi-edit transaction.


Constructor Summary
protected TransactionCounter()
          Default constructor.
 
Method Summary
protected  void commit(Connection con)
          Handles the commit for the transaction.
protected  void increment()
          Increments the transaction count by one.
protected  void prepare(Connection con)
          Prepares the transaction count prior to any edits.
protected  void reset(Connection con)
          Resets the transaction counter.
protected  void rollback(Connection con)
          Handles the rollback for the transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionCounter

protected TransactionCounter()
Default constructor.

Method Detail

commit

protected void commit(Connection con)
               throws SQLException
Handles the commit for the transaction.
If this TranasctionCount was not prepared, no commit is executed.
If the counter is zero, no commit is executed.

Parameters:
con - the JDBC connection
Throws:
SQLException - if an exception occurs

increment

protected void increment()
Increments the transaction count by one.


prepare

protected void prepare(Connection con)
                throws SQLException
Prepares the transaction count prior to any edits.
Auto commit is set to false for the connection.
This method must be executed prior to any commit or rollback.

Parameters:
con - the JDBC connection
Throws:
SQLException - if an exception occurs

reset

protected void reset(Connection con)
Resets the transaction counter.

Auto commit is set to it's previous state for the connection.

Parameters:
con - the JDBC connection

rollback

protected void rollback(Connection con)
Handles the rollback for the transaction.
A single rolback is executed for each incremented transaction count.
If this TranasctionCount was not prepared, no rollback is executed.

Parameters:
con - the JDBC connection

Esri Geoportal Server
1.0

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