Kodo 4.2.0. generated on July 28 2008

kodo.jdbc.kernel
Class TableLockUpdateManager

java.lang.Object
  extended by org.apache.openjpa.jdbc.kernel.AbstractUpdateManager
      extended by kodo.jdbc.kernel.AutoOrderUpdateManager
          extended by kodo.jdbc.kernel.TableLockUpdateManager
All Implemented Interfaces:
UpdateManager, Configurable

public class TableLockUpdateManager
extends AutoOrderUpdateManager

Example update manager, capable of statement batching, that ignores foreign keys and autoincrement, but optimizes for table level locking. Esp. important when using table level locking and trying to avoid deadlocks.


Nested Class Summary
protected static class TableLockUpdateManager.TableRows
          Rows for a particular table.
 
Nested classes/interfaces inherited from class kodo.jdbc.kernel.AutoOrderUpdateManager
AutoOrderUpdateManager.SQLComparator
 
Nested classes/interfaces inherited from class org.apache.openjpa.jdbc.kernel.AbstractUpdateManager
AbstractUpdateManager.CustomMapping
 
Field Summary
 
Fields inherited from class kodo.jdbc.kernel.AutoOrderUpdateManager
batch, maxBatch, sqlComparator
 
Fields inherited from class org.apache.openjpa.jdbc.kernel.AbstractUpdateManager
conf, dict
 
Constructor Summary
TableLockUpdateManager()
           
 
Method Summary
protected  Collection flush(RowManager rowMgr, PreparedStatementManager psMgr, Collection exceps)
           
protected  RowManager newRowManager()
           
 boolean orderDirty()
           
protected  Collection sortTables(Collection trs)
          Sort TableLockUpdateManager.TableRows by table.
 
Methods inherited from class kodo.jdbc.kernel.AutoOrderUpdateManager
flush, getMaximizeBatchSize, newPreparedStatementManager, setConfiguration, setMaximizeBatchSize
 
Methods inherited from class org.apache.openjpa.jdbc.kernel.AbstractUpdateManager
addException, delete, endConfiguration, flush, insert, populateRowManager, startConfiguration, update, updateIndicators
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableLockUpdateManager

public TableLockUpdateManager()
Method Detail

orderDirty

public boolean orderDirty()

newRowManager

protected RowManager newRowManager()
Specified by:
newRowManager in class AbstractUpdateManager

flush

protected Collection flush(RowManager rowMgr,
                           PreparedStatementManager psMgr,
                           Collection exceps)
Specified by:
flush in class AbstractUpdateManager

sortTables

protected Collection sortTables(Collection trs)
Sort TableLockUpdateManager.TableRows by table. This implementation sorts tables lexically by table name. This is good for avoiding deadlocks in systems with table level locking. Some orderings may avoid deadlocks and be more scalable. E.g. sorting such that certain tables always come last will reduce the amount of time that those tables are locked. Sort order should probably be constant, though, in order to avoid deadlocks.


Kodo 4.2.0. generated on July 28 2008

Copyright 2001-2006 BEA Systems, Inc. All Rights Reserved.