com.ibatis.dao.engine.transaction.toplink
Class ToplinkDaoTransaction

java.lang.Object
  extended bycom.ibatis.dao.engine.transaction.toplink.ToplinkDaoTransaction
All Implemented Interfaces:
DaoTransaction

public class ToplinkDaoTransaction
extends java.lang.Object
implements DaoTransaction

The ToplinkDaoTransaction class represents an abstract DaoTransaction implemented using Toplink. Toplink provides transaction management methods to commit and rollback transactions.

Version:
$Revision: 152595 $ $Date: 2004-12-28 09:46:14 -0700 (Tue, 28 Dec 2004) $
Author:
Wayne Gentile

Constructor Summary
ToplinkDaoTransaction(oracle.toplink.sessions.UnitOfWork uow, oracle.toplink.threetier.Server server)
          Constructor for the ToplinkDaoTransaction class that accepts a Toplink Server object for creating client sessions.
 
Method Summary
 void commit()
          Commits all pending changes to persistent storage.
protected  void finalize()
          Clean up outstanding units of work and sessions.
 oracle.toplink.sessions.Session getSession()
          Gets the Toplink Session associated with this transaction.
 oracle.toplink.sessions.UnitOfWork getUnitOfWork()
          Gets the active unit of work.
 void rollback()
          Rollback all pending changes to persistent storage and revert changes back to the original state.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToplinkDaoTransaction

public ToplinkDaoTransaction(oracle.toplink.sessions.UnitOfWork uow,
                             oracle.toplink.threetier.Server server)
                      throws DaoException
Constructor for the ToplinkDaoTransaction class that accepts a Toplink Server object for creating client sessions.

Parameters:
uow - The Toplink UnitOfWork associated with the transaction
server - The Toplink server used to acquire client sessions
Throws:
DaoException - If a DaoException is thrown
Method Detail

getSession

public oracle.toplink.sessions.Session getSession()
                                           throws DaoException
Gets the Toplink Session associated with this transaction.

Returns:
The Toplink Session
Throws:
DaoException - If a data access exception occurs

getUnitOfWork

public oracle.toplink.sessions.UnitOfWork getUnitOfWork()
                                                 throws DaoException
Gets the active unit of work.

Returns:
The unitOfWork instance
Throws:
DaoException - If a data access exception occurs

commit

public void commit()
            throws DaoException
Commits all pending changes to persistent storage.

Throws:
DaoException - If a data access exception occurs

rollback

public void rollback()
              throws DaoException
Rollback all pending changes to persistent storage and revert changes back to the original state.

Throws:
DaoException - If a data access exception occurs

finalize

protected void finalize()
                 throws java.lang.Throwable
Clean up outstanding units of work and sessions.

Throws:
java.lang.Throwable - If any exception occurs