org.firebirdsql.jca

Class FBLocalTransaction

Implemented Interfaces:
FirebirdLocalTransaction, LocalTransaction

public class FBLocalTransaction
extends java.lang.Object
implements FirebirdLocalTransaction, javax.resource.cci.LocalTransaction

The class FBLocalTransaction implements LocalTransaction both in the cci and spi meanings. A flag is used to distinguish the current functionality. This class works by delegating the operations to the internal implementations of the XAResource functionality in FBManagedConnection.
Version:
1.0
Author:
David Jencks

Nested Class Summary

static class
FBLocalTransaction.FBLocalXid

Field Summary

protected ConnectionEvent
beginEvent
protected ConnectionEvent
commitEvent
protected FBManagedConnection
mc
protected ConnectionEvent
rollbackEvent
protected Xid
xid

Constructor Summary

FBLocalTransaction(FBManagedConnection mc, AbstractConnection c)

Method Summary

void
begin()
Begin a local transaction.
void
commit()
Commit a local transaction.
Xid
getXid()
Get the associated Xid.
boolean
inTransaction()
Check whether a started transaction is associated with the current database connection.
void
internalBegin()
Perform the internal operations to begin a local transaction.
void
internalCommit()
Perform the internal processing to commit a local transaction.
void
internalRollback()
Perform the internal processing to rollback a local transaction.
void
rollback()
Rollback a local transaction.

Field Details

beginEvent

protected final ConnectionEvent beginEvent

commitEvent

protected final ConnectionEvent commitEvent

mc

protected final FBManagedConnection mc

rollbackEvent

protected final ConnectionEvent rollbackEvent

xid

protected Xid xid

Constructor Details

FBLocalTransaction

public FBLocalTransaction(FBManagedConnection mc,
                          AbstractConnection c)

Method Details

begin

public void begin()
            throws ResourceException
Begin a local transaction.

commit

public void commit()
            throws ResourceException
Commit a local transaction.

getXid

public Xid getXid()
Get the associated Xid.
Specified by:
getXid in interface FirebirdLocalTransaction
Returns:
instance of Xid representing a transaction ID that is managed by this local transaction.

inTransaction

public boolean inTransaction()
            throws ResourceException
Check whether a started transaction is associated with the current database connection.
Specified by:
inTransaction in interface FirebirdLocalTransaction

internalBegin

public void internalBegin()
            throws ResourceException
Perform the internal operations to begin a local transaction.

internalCommit

public void internalCommit()
            throws ResourceException
Perform the internal processing to commit a local transaction.

internalRollback

public void internalRollback()
            throws ResourceException
Perform the internal processing to rollback a local transaction.

rollback

public void rollback()
            throws ResourceException
Rollback a local transaction.

Copyright B) 2001 David Jencks and other authors. All rights reserved.