org.apache.openjpa.writebehind
Class WriteBehindStoreManager

java.lang.Object
  extended by org.apache.openjpa.kernel.DelegatingStoreManager
      extended by org.apache.openjpa.writebehind.WriteBehindStoreManager
All Implemented Interfaces:
StoreManager, Closeable

public class WriteBehindStoreManager
extends DelegatingStoreManager


Field Summary
protected  boolean _cacheDeletes
           
protected  boolean _cacheInserts
           
protected  boolean _cacheUpdates
           
protected  Set<Class<?>> excludedTypes
           
protected  Set<Class<?>> includedTypes
           
static int OP_DELETE
           
static int OP_INSERT
           
static int OP_UPDATE
           
 
Fields inherited from interface org.apache.openjpa.kernel.StoreManager
FORCE_LOAD_ALL, FORCE_LOAD_DFG, FORCE_LOAD_NONE, FORCE_LOAD_REFRESH, VERSION_DIFFERENT, VERSION_EARLIER, VERSION_LATER, VERSION_SAME
 
Constructor Summary
WriteBehindStoreManager(StoreManager store)
           
WriteBehindStoreManager(StoreManager store, WriteBehindCache wbCache)
           
 
Method Summary
 boolean cacheAble(OpenJPAStateManager sm)
           
 void commit()
          Commit the current data store transaction.
 Collection<Exception> flush(Collection<OpenJPAStateManager> sms)
          Flush the given state manager collection to the datastore, returning a collection of exceptions encountered during flushing.
 Collection<Exception> flushBehind(Collection<OpenJPAStateManager> sms)
           
protected  int getOperation(OpenJPAStateManager sm)
           
 void rollback()
          Rollback the current data store transaction.
 
Methods inherited from class org.apache.openjpa.kernel.DelegatingStoreManager
assignField, assignObjectId, beforeStateChange, begin, beginOptimistic, cancelAll, close, compareVersion, copyDataStoreId, equals, executeExtent, exists, getClientConnection, getDataStoreIdSequence, getDataStoreIdType, getDelegate, getInnermostDelegate, getManagedType, getValueSequence, hashCode, initialize, load, loadAll, newDataStoreId, newFetchConfiguration, newQuery, releaseConnection, retainConnection, rollbackOptimistic, setContext, syncVersion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

includedTypes

protected Set<Class<?>> includedTypes

excludedTypes

protected Set<Class<?>> excludedTypes

_cacheInserts

protected boolean _cacheInserts

_cacheUpdates

protected boolean _cacheUpdates

_cacheDeletes

protected boolean _cacheDeletes

OP_INSERT

public static final int OP_INSERT
See Also:
Constant Field Values

OP_DELETE

public static final int OP_DELETE
See Also:
Constant Field Values

OP_UPDATE

public static final int OP_UPDATE
See Also:
Constant Field Values
Constructor Detail

WriteBehindStoreManager

public WriteBehindStoreManager(StoreManager store)

WriteBehindStoreManager

public WriteBehindStoreManager(StoreManager store,
                               WriteBehindCache wbCache)
Method Detail

flush

public Collection<Exception> flush(Collection<OpenJPAStateManager> sms)
Description copied from interface: StoreManager
Flush the given state manager collection to the datastore, returning a collection of exceptions encountered during flushing. The given collection may include states that do not require data store action, such as persistent-clean instances or persistent-dirty instances that have not been modified since they were last flushed. For datastore updates and inserts, the dirty, non-flushed fields of each state should be flushed. New instances without an assigned object id should be given one via OpenJPAStateManager.setObjectId(java.lang.Object). New instances with value-strategy fields that have not been assigned yet should have their fields set. Datastore version information should be updated during flush, and the state manager's version indicator updated through the OpenJPAStateManager.setNextVersion(java.lang.Object) method. The current version will roll over to this next version upon successful commit.

Specified by:
flush in interface StoreManager
Overrides:
flush in class DelegatingStoreManager
See Also:
org.apache.openjpa.util.ApplicationIds#assign()

commit

public void commit()
Description copied from interface: StoreManager
Commit the current data store transaction.

Specified by:
commit in interface StoreManager
Overrides:
commit in class DelegatingStoreManager

rollback

public void rollback()
Description copied from interface: StoreManager
Rollback the current data store transaction.

Specified by:
rollback in interface StoreManager
Overrides:
rollback in class DelegatingStoreManager

flushBehind

public Collection<Exception> flushBehind(Collection<OpenJPAStateManager> sms)

cacheAble

public boolean cacheAble(OpenJPAStateManager sm)

getOperation

protected int getOperation(OpenJPAStateManager sm)


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.