Holger's
Java API

com.antelmann.sql
Class SQLTransaction

java.lang.Object
  extended by com.antelmann.sql.SQLTransaction
All Implemented Interfaces:
DBTransaction

public class SQLTransaction
extends Object
implements DBTransaction

implements a DBTransaction based on JDBC access.

Author:
Holger Antelmann

Constructor Summary
SQLTransaction(SQLDatabase transaction)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLTransaction

public SQLTransaction(SQLDatabase transaction)
Method Detail

getDatabase

public Database getDatabase()
Description copied from interface: DBTransaction
gives access to the associated Database

Specified by:
getDatabase in interface DBTransaction

begin

public void begin()
           throws TransactionException
Description copied from interface: DBTransaction
sets the transaction to active and allows access to the Resources provided that the calling thread holds the lock on this instance.

Specified by:
begin in interface DBTransaction
Throws:
TransactionException - if the transaction is already active

commit

public void commit()
            throws DatabaseException
Description copied from interface: DBTransaction
commits all data within the transaction scope to the underlying database

Specified by:
commit in interface DBTransaction
Throws:
TransactionException - if the transaction is already active
DatabaseException - if the transaction could not be committed to the underlying service

abort

public void abort()
           throws DatabaseException
Description copied from interface: DBTransaction
aborts this transaction

Specified by:
abort in interface DBTransaction
Throws:
TransactionException - if the transaction is already active
DatabaseException - if the transaction could not be aborted from the underlying service

isActive

public boolean isActive()
Description copied from interface: DBTransaction
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.

Specified by:
isActive in interface DBTransaction


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