org.perfectjpattern.jee.api.integration.dao
Interface ITransaction


public interface ITransaction

Abstract definition of Transaction available for the DAO implementation. The DAO API exposes this interface but it will be automatically adapted from the underlying JPA-specific implementation (see IAdapter).

JPA and specific implementations define similar abstractions e.g. Transaction but despite their similarities, their types actually mismatch making it difficult to provide a generic unified DAO solution.

Note that this is a subset of the functionality that the underlying implementation offers. This is the subset required to make the DAO portable. If required, it is possible to get the underlying implementation using ISession.getDelegate()

Version:
$Revision: 1.0 $Date: Feb 10, 2009 5:56:17 PM $
Author:
Giovanni Azua
 

Method Summary
 void begin()
          Demarcates the beginning of a Transaction
 void commit()
          Commits the current Transaction
 boolean isActive()
          Returns true if the transaction currently Active, false otherwise
 void rollback()
          Rolls back the current Transaction
 

Method Detail

begin

void begin()
           throws DaoException,
                  UnsupportedOperationException
Demarcates the beginning of a Transaction

Throws:
DaoException
UnsupportedOperationException - Transactions are not supported by the underlying persistent store.
See Also:
#isSupported()

commit

void commit()
            throws DaoException,
                   UnsupportedOperationException
Commits the current Transaction

Throws:
DaoException
UnsupportedOperationException - Transactions are not supported by the underlying persistent store.
See Also:
#isSupported()

rollback

void rollback()
              throws DaoException,
                     UnsupportedOperationException
Rolls back the current Transaction

Throws:
DaoException
UnsupportedOperationException - Transactions are not supported by the underlying persistent store.
See Also:
#isSupported()

isActive

boolean isActive()
Returns true if the transaction currently Active, false otherwise

Returns:
true if the transaction currently Active, false otherwise


Copyright © 2007-2009. All Rights Reserved.