org.apache.derby.iapi.sql.execute
Interface RowChanger

All Known Implementing Classes:
RowChangerImpl

public interface RowChanger

Perform row at a time DML operations of tables and maintain indexes.


Method Summary
 void close()
          Close this RowChanger.
 void deleteRow(ExecRow baseRow, RowLocation baseRowLocation)
          Delete a row from the table and perform associated index maintenance.
 void finish()
          Finish processing the changes.
 ConglomerateController getHeapConglomerateController()
          Return the ConglomerateController from this RowChanger.
 void insertRow(ExecRow baseRow)
          Insert a row into the table and perform associated index maintenance.
 void open(int lockMode)
          Open this RowChanger.
 void openForUpdate(boolean[] fixOnUpdate, int lockMode, boolean wait)
          Open this RowChanger to avoid fixing indexes that do not change during update operations.
 void setIndexNames(java.lang.String[] indexNames)
          Sets the index names of the tables indices.
 void setRowHolder(TemporaryRowHolder rowHolder)
          Set the row holder for this changer to use.
 void updateRow(ExecRow oldBaseRow, ExecRow newBaseRow, RowLocation baseRowLocation)
          Update a row in the table and perform associated index maintenance.
 

Method Detail

open

public void open(int lockMode)
          throws StandardException
Open this RowChanger.

Note to avoid the cost of fixing indexes that do not change during update operations use openForUpdate().

Parameters:
lockMode - The lock mode to use (row or table, see TransactionController)
Throws:
StandardException - thrown on failure to convert

setRowHolder

public void setRowHolder(TemporaryRowHolder rowHolder)
Set the row holder for this changer to use. If the row holder is set, it wont bother saving copies of rows needed for deferred processing. Also, it will never close the passed in rowHolder.

Parameters:
rowHolder - the row holder

setIndexNames

public void setIndexNames(java.lang.String[] indexNames)
Sets the index names of the tables indices. Used for error reporting.

Parameters:
indexNames - Names of all the indices on this table.

openForUpdate

public void openForUpdate(boolean[] fixOnUpdate,
                          int lockMode,
                          boolean wait)
                   throws StandardException
Open this RowChanger to avoid fixing indexes that do not change during update operations.

Parameters:
fixOnUpdate - fixOnUpdat[ix] == true ==> fix index 'ix' on an update operation.
lockMode - The lock mode to use (row or table, see TransactionController)
wait - If true, then the caller wants to wait for locks. False will be when we using a nested user xaction - we want to timeout right away if the parent holds the lock. (bug 4821)
Throws:
StandardException - thrown on failure to convert

insertRow

public void insertRow(ExecRow baseRow)
               throws StandardException
Insert a row into the table and perform associated index maintenance.

Parameters:
baseRow - the row.
Throws:
StandardException - Thrown on error

deleteRow

public void deleteRow(ExecRow baseRow,
                      RowLocation baseRowLocation)
               throws StandardException
Delete a row from the table and perform associated index maintenance.

Parameters:
baseRow - the row.
baseRowLocation - the row's base conglomerate location
Throws:
StandardException - Thrown on error

updateRow

public void updateRow(ExecRow oldBaseRow,
                      ExecRow newBaseRow,
                      RowLocation baseRowLocation)
               throws StandardException
Update a row in the table and perform associated index maintenance.

Parameters:
oldBaseRow - the old image of the row.
newBaseRow - the new image of the row.
baseRowLocation - the row's base conglomerate location
Throws:
StandardException - Thrown on error

finish

public void finish()
            throws StandardException
Finish processing the changes. This means applying the deferred inserts for updates to unique indexes.

Throws:
StandardException - Thrown on error

close

public void close()
           throws StandardException
Close this RowChanger.

Throws:
StandardException - Thrown on error

getHeapConglomerateController

public ConglomerateController getHeapConglomerateController()
Return the ConglomerateController from this RowChanger. This is useful when copying properties from heap to temp conglomerate on insert/update/delete.

Returns:
The ConglomerateController from this RowChanger.

Built on Mon 2007-06-04 09:58:47+0400, from revision ???

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.