org.apache.ojb.otm.core
Class Transaction

java.lang.Object
  extended byorg.apache.ojb.otm.core.Transaction

public class Transaction
extends java.lang.Object

Transaction delivers the core function of OTMKit - to manage objects within the context of a transaction.

Author:
Raghu Rajah

Constructor Summary
Transaction()
           
 
Method Summary
 void begin()
           
 void checkpoint()
          Checkpoint this transaction.
 void commit()
          Commit this transaction.
 OTMKit getKit()
           
 boolean isInProgress()
           
 void registerConnection(OTMConnection connection)
          Associate a connection to this transaction.
 void registerListener(TransactionListener listener)
          Adds a listener to this transaction.
 void rollback()
          Rollback this transaction.
 void setKit(OTMKit kit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transaction

public Transaction()
Method Detail

getKit

public OTMKit getKit()

setKit

public void setKit(OTMKit kit)

begin

public void begin()
           throws TransactionException
Throws:
TransactionException

commit

public void commit()
            throws TransactionException
Commit this transaction. A commit notifies all listeners of this transaction. It then initiates a two phase commit on connections. Since, connections cannot be associated to more than one transaction at any given point in time, there is no neccessity to identify transaction.

Throws:
TransactionException

checkpoint

public void checkpoint()
                throws TransactionException
Checkpoint this transaction.

Throws:
TransactionException

rollback

public void rollback()
              throws TransactionException
Rollback this transaction. A rollback on the transaction, notifies all its listeners. It, then initiates a rollback on all associated connections.

Throws:
TransactionException

isInProgress

public boolean isInProgress()

registerConnection

public void registerConnection(OTMConnection connection)
Associate a connection to this transaction. A OTMConnection can be registered to atmost one transaction, while a transaction can manage multiple connections.

Parameters:
connection - the connection to register

registerListener

public void registerListener(TransactionListener listener)
Adds a listener to this transaction. Listeners get boundary notifications of this transaction.

Parameters:
listener - the listener of this transaction


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14