org.apache.ojb.broker.core
Class PersistenceBrokerFactorySyncImpl.PersistenceBrokerSyncImpl

java.lang.Object
  extended by org.apache.ojb.broker.core.DelegatingPersistenceBroker
      extended by org.apache.ojb.broker.core.PoolablePersistenceBroker
          extended by org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl.PersistenceBrokerSyncImpl
All Implemented Interfaces:
javax.transaction.Synchronization, PBState, PersistenceBroker, PersistenceBrokerInternal, org.apache.ojb.broker.util.configuration.Configurable, ObjectContainer
Enclosing class:
PersistenceBrokerFactorySyncImpl

public static class PersistenceBrokerFactorySyncImpl.PersistenceBrokerSyncImpl
extends PoolablePersistenceBroker
implements javax.transaction.Synchronization


Constructor Summary
PersistenceBrokerFactorySyncImpl.PersistenceBrokerSyncImpl(PersistenceBrokerInternal broker, org.apache.commons.pool.KeyedObjectPool pool)
           
 
Method Summary
 void abortTransaction()
          Aborts and closes the current transaction.
 void afterCompletion(int status)
           
 void beforeCompletion()
           
 void beginTransaction()
          Begins a transaction against the underlying RDBMS.
 boolean close()
          Closes this broker so that no further requests may be made on it.
 void commitTransaction()
          Commits and closes the current transaction.
 
Methods inherited from class org.apache.ojb.broker.core.PoolablePersistenceBroker
destroy
 
Methods inherited from class org.apache.ojb.broker.core.DelegatingPersistenceBroker
addListener, addListener, addMtoNImplementor, checkRefreshRelationships, clearCache, configure, createProxy, delete, delete, deleteByQuery, deleteMtoNImplementor, fireBrokerEvent, fireBrokerEvent, fireBrokerEvent, getClassDescriptor, getCollectionByQuery, getCollectionByQuery, getCount, getDelegate, getDescriptorRepository, getInnermostDelegate, getIteratorByQuery, getObjectByIdentity, getObjectByQuery, getPBKey, getPKEnumerationByQuery, getProxyFactory, getReferenceBroker, getRelationshipPrefetcherFactory, getReportQueryIteratorByQuery, getTopLevelClass, hasClassDescriptor, isClosed, isInTransaction, isManaged, query, removeAllListeners, removeAllListeners, removeFromCache, removeListener, retrieveAllReferences, retrieveReference, serviceBrokerHelper, serviceConnectionManager, serviceIdentity, serviceJdbcAccess, serviceObjectCache, serviceSequenceManager, serviceSqlGenerator, serviceStatementManager, setClosed, setDelegate, setManaged, store, store, store
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceBrokerFactorySyncImpl.PersistenceBrokerSyncImpl

public PersistenceBrokerFactorySyncImpl.PersistenceBrokerSyncImpl(PersistenceBrokerInternal broker,
                                                                  org.apache.commons.pool.KeyedObjectPool pool)
Method Detail

beforeCompletion

public void beforeCompletion()
Specified by:
beforeCompletion in interface javax.transaction.Synchronization

afterCompletion

public void afterCompletion(int status)
Specified by:
afterCompletion in interface javax.transaction.Synchronization

close

public boolean close()
Description copied from interface: PersistenceBroker
Closes this broker so that no further requests may be made on it. Closing a broker might release it to the pool of available brokers, or might be garbage collected, at the option of the implementation.

Specified by:
close in interface PersistenceBroker
Overrides:
close in class PoolablePersistenceBroker
Returns:
true if the broker was successfully closed

beginTransaction

public void beginTransaction()
                      throws TransactionInProgressException,
                             TransactionAbortedException
Description copied from interface: PersistenceBroker
Begins a transaction against the underlying RDBMS.

Specified by:
beginTransaction in interface PersistenceBroker
Overrides:
beginTransaction in class DelegatingPersistenceBroker
Throws:
TransactionInProgressException - If there is already a transaction in progress
TransactionAbortedException

commitTransaction

public void commitTransaction()
                       throws TransactionNotInProgressException,
                              TransactionAbortedException
Description copied from interface: PersistenceBroker
Commits and closes the current transaction. This commits all database-changing statements (e.g. UPDATE, INSERT and DELETE) issued within the transaction since the last commit to the database, and releases any locks held by the transaction.

Specified by:
commitTransaction in interface PersistenceBroker
Overrides:
commitTransaction in class DelegatingPersistenceBroker
Throws:
TransactionNotInProgressException - If there is no transaction currently in progress
TransactionAbortedException - If the transaction cannot be committed

abortTransaction

public void abortTransaction()
                      throws TransactionNotInProgressException
Description copied from interface: PersistenceBroker
Aborts and closes the current transaction. This abandons all persistent object modifications and releases the associated locks.

Specified by:
abortTransaction in interface PersistenceBroker
Overrides:
abortTransaction in class DelegatingPersistenceBroker
Throws:
TransactionNotInProgressException - If no transaction is currently in progress


(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