Package org.apache.openjpa.kernel
Class OpenJPASavepoint
java.lang.Object
org.apache.openjpa.kernel.OpenJPASavepoint
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractJDBCSavepointManager.ConnectionSavepoint
Represents a savepoint where operations afterwards can be rolled
back and restored to this point
- Since:
- 0.3.4
- Author:
- Steve Kim
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn the Broker associated with this savepoint.boolean
Whether this savepoint copies the field values of retained instances.getName()
Return the name for this savepoint.protected Map<StateManagerImpl,
org.apache.openjpa.kernel.SavepointFieldManager> Return the map of states to savepoint data.void
release
(boolean user) Release this savepoint and any associated resources.Collection<org.apache.openjpa.kernel.SavepointFieldManager>
rollback
(Collection<OpenJPASavepoint> previous) Handle the rolled back state, returning saved data.void
save
(Collection<StateManagerImpl> states) Set this savepoint, saving any state for the passed-inOpenJPAStateManager
s as necessary.
-
Constructor Details
-
OpenJPASavepoint
Constructor. Indicate whether to copy field data into memory.
-
-
Method Details
-
getBroker
Return the Broker associated with this savepoint. -
getName
Return the name for this savepoint. -
getCopyFieldState
public boolean getCopyFieldState()Whether this savepoint copies the field values of retained instances. -
getStates
Return the map of states to savepoint data. -
save
Set this savepoint, saving any state for the passed-inOpenJPAStateManager
s as necessary. -
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
-
rollback
public Collection<org.apache.openjpa.kernel.SavepointFieldManager> rollback(Collection<OpenJPASavepoint> 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
-