Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.runtime
Class KodoSavepoint

    java.lang.Object
      |
      +--kodo.runtime.KodoSavepoint

Direct Known Subclasses:
  AbstractJDBCSavepointManager.ConnectionSavepoint

public class KodoSavepoint
extends Object

Represents a savepoint where operations afterwards can be rolled back and restored to this point

Since:
  3.4

Field Summary
`static int` | `FLUSH` Flush mode where `initialize` will call {@KodoPersistenceManager#flush}
`static int` | `NO_FLUSH` Flush mode where no flush method will be called.
`static int` | `PRE_FLUSH` Flush mode where `initialize()` will call {@KodoPersistenceManager#preFlush}

Constructor Summary
`KodoSavepoint(KodoPersistenceManager pm, String name)` Constructor.

Method Summary
`boolean` | `getCopyFields()` Return whether this savepoint should copy state into memory
`int` | `getFlushMode()` Return the flush operation to use on initialize.
`String` | `getName()` Return the name for this savepoint.
`KodoPersistenceManager` | `getPersistenceManager()` Return the KodoPersistenceManager associated with this savepoint.
`protected Map` | `getStates()` Return a Map of states to savepoint data.
`void` | `initialize()` Initialize any resources necessary for this savepoint.
`void` | `release(boolean user)` Release this savepoint and any associated resources.
`protected Collection` | `rollback(Collection previous)` Handle the rolled back state, returning saved data.
`void` | `save(Collection states)` Set this savepoint, saving any state for the passed-in `KodoStateManager`s as necessary.
`void` | `setCopyFields(boolean copy)` Set whether to copy state into memory
`void` | `setFlushMode(int flush)` Set the flush operation to use on initialize.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NO_FLUSH

    public static final int NO_FLUSH

  Flush mode where no flush method will be called.

### PRE_FLUSH

    public static final int PRE_FLUSH

  Flush mode where `initialize()` will call {@KodoPersistenceManager#preFlush}

### FLUSH

    public static final int FLUSH

  Flush mode where `initialize` will call {@KodoPersistenceManager#flush}

Constructor Detail

### KodoSavepoint

    public KodoSavepoint(KodoPersistenceManager pm,
                         String name)

  Constructor. Indicate whether to copy field data into memory.

Method Detail

### getCopyFields

    public boolean getCopyFields()

  Return whether this savepoint should copy state into memory

### setCopyFields

    public void setCopyFields(boolean copy)

  Set whether to copy state into memory

### getFlushMode

    public int getFlushMode()

  Return the flush operation to use on initialize.

### setFlushMode

    public void setFlushMode(int flush)

  Set the flush operation to use on initialize.

### getPersistenceManager

    public KodoPersistenceManager getPersistenceManager()

  Return the KodoPersistenceManager associated with this savepoint.

### getName

    public String getName()

  Return the name for this savepoint.

### release

    public void release(boolean user)

  Release this savepoint and any associated resources. Releases will happen in reverse order of creation.
  Parameters:
    `user` - if true, user initiated, otherwise a side effect of another savepoint's release/rollback

### getStates

    protected Map getStates()

  Return a Map of states to savepoint data.

### rollback

    protected Collection rollback(Collection previous)

  Handle the rolled back state, returning saved data. Subclasses should return the collection returned from this method.
  Parameters:
    `previous` - previous savepoints set in the transaction

### initialize

    public void initialize()

  Initialize any resources necessary for this savepoint. Will issue the corresponding `KodoPersistenceManager` flush command based on `getFlushMode()`

### save

    public void save(Collection states)

  Set this savepoint, saving any state for the passed-in `KodoStateManager`s as necessary.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.