Holger's
Java API

com.antelmann.mgmt
Interface DBTransaction

All Known Implementing Classes:
SQLTransaction

public interface DBTransaction

a transaction controlls access to all resources of a Database through DBClassStore instances. A Thread accessing resources must own the monitor on the active transaction. To ensure thread-save consistency on a transaction, a thread must maintain ownership over the transaction throughout the duration of a transaction.

Author:
Holger Antelmann
See Also:
Database

Method Summary
 void abort()
          aborts this transaction
 void begin()
          sets the transaction to active and allows access to the Resources provided that the calling thread holds the lock on this instance.
 void commit()
          commits all data within the transaction scope to the underlying database
 Database getDatabase()
          gives access to the associated Database
 boolean isActive()
          if true, the transaction has begun and not yet committed or aborted.
 

Method Detail

getDatabase

Database getDatabase()
gives access to the associated Database


begin

void begin()
           throws TransactionException
sets the transaction to active and allows access to the Resources provided that the calling thread holds the lock on this instance.

Throws:
TransactionException - if the transaction is already active

commit

void commit()
            throws TransactionException,
                   DatabaseException
commits all data within the transaction scope to the underlying database

Throws:
TransactionException - if the transaction is already active
DatabaseException - if the transaction could not be committed to the underlying service

abort

void abort()
           throws TransactionException,
                  DatabaseException
aborts this transaction

Throws:
TransactionException - if the transaction is already active
DatabaseException - if the transaction could not be aborted from the underlying service

isActive

boolean isActive()
if true, the transaction has begun and not yet committed or aborted. Access to resources is only possible if this method returns true and the calling thread holds the lock on this instance.



(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads