org.apache.ojb.odmg
Class LocalTxManager

java.lang.Object
  extended by org.apache.ojb.odmg.LocalTxManager
All Implemented Interfaces:
org.apache.ojb.broker.util.configuration.Configurable, OJBTxManager

public class LocalTxManager
extends java.lang.Object
implements OJBTxManager

In a non-appserver environment, without a transaction manager, we can safely associate the current ODMG transaction with the calling thread.

Version:
$Id: LocalTxManager.java 365232 2005-12-21 22:36:07Z tomdz $
Author:
Armin Waibel, Matthew Baird

Constructor Summary
LocalTxManager()
           
 
Method Summary
 void abortExternalTx(TransactionImpl odmgTrans)
          included to keep interface contract consistent.
 void configure(org.apache.ojb.broker.util.configuration.Configuration config)
          configure an object using the Configuration pConfig
 void deregisterTx(java.lang.Object token)
          remove the current transaction from the map key'd by the calling thread.
 TransactionImpl getCurrentTransaction()
          Returns the current transaction for the calling thread.
 TransactionImpl getTransaction()
          Returns the current transaction for the calling thread or null if no transaction was found.
 void registerTx(TransactionImpl tx)
          add the current transaction to the map key'd by the calling thread.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalTxManager

public LocalTxManager()
Method Detail

getCurrentTransaction

public TransactionImpl getCurrentTransaction()
Returns the current transaction for the calling thread.

Specified by:
getCurrentTransaction in interface OJBTxManager
Throws:
TransactionNotInProgressException - TransactionNotInProgressException if no transaction was found.

getTransaction

public TransactionImpl getTransaction()
Returns the current transaction for the calling thread or null if no transaction was found.

Specified by:
getTransaction in interface OJBTxManager

registerTx

public void registerTx(TransactionImpl tx)
add the current transaction to the map key'd by the calling thread.

Specified by:
registerTx in interface OJBTxManager

deregisterTx

public void deregisterTx(java.lang.Object token)
remove the current transaction from the map key'd by the calling thread.

Specified by:
deregisterTx in interface OJBTxManager

abortExternalTx

public void abortExternalTx(TransactionImpl odmgTrans)
included to keep interface contract consistent.

Specified by:
abortExternalTx in interface OJBTxManager

configure

public void configure(org.apache.ojb.broker.util.configuration.Configuration config)
Description copied from interface: org.apache.ojb.broker.util.configuration.Configurable
configure an object using the Configuration pConfig

Specified by:
configure in interface org.apache.ojb.broker.util.configuration.Configurable
Parameters:
config - the Configuration object used to configure current instance


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30