Package org.datanucleus.flush
Class FlushNonReferential
- java.lang.Object
-
- org.datanucleus.flush.FlushNonReferential
-
- All Implemented Interfaces:
FlushProcess
public class FlushNonReferential extends Object implements FlushProcess
Flush method for cases where the datastore doesn't use referential integrity so we can send batches of deletes, then batches of inserts, then any updates to optimise the persistence. This also makes use of the OperationQueue to do more intelligent handling of cascade delete when elements are removed from Collections, checking if it is later added to a different collection.
-
-
Constructor Summary
Constructors Constructor Description FlushNonReferential()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<NucleusOptimisticException>
execute(ExecutionContext ec, Collection<DNStateManager> primarySMs, Collection<DNStateManager> secondarySMs, OperationQueue opQueue)
Execute the flush.List<NucleusOptimisticException>
flushDeleteInsertUpdateGrouped(Set<DNStateManager> smsToFlush, ExecutionContext ec)
Method that does the flushing of the passed StateManagers, grouping them into all DELETEs, then all INSERTs, finally all UPDATEs.
-
-
-
Method Detail
-
execute
public List<NucleusOptimisticException> execute(ExecutionContext ec, Collection<DNStateManager> primarySMs, Collection<DNStateManager> secondarySMs, OperationQueue opQueue)
Description copied from interface:FlushProcess
Execute the flush.- Specified by:
execute
in interfaceFlushProcess
- Parameters:
ec
- ExecutionContextprimarySMs
- StateManagers that were made dirty by direct API calls. Cleared during this methodsecondarySMs
- StateManagers that were made dirty by reachability. Cleared during this methodopQueue
- Queue of operations- Returns:
- Any optimistic exceptions during the deletes/inserts/updates
-
flushDeleteInsertUpdateGrouped
public List<NucleusOptimisticException> flushDeleteInsertUpdateGrouped(Set<DNStateManager> smsToFlush, ExecutionContext ec)
Method that does the flushing of the passed StateManagers, grouping them into all DELETEs, then all INSERTs, finally all UPDATEs. The StorePersistenceHandler will get calls to deleteObjects, insertObjects and updateObject (for each other one). Note that this is in a separate method to allow calls by other FlushProcesses that want to take advantage of the basic flush method without- Parameters:
smsToFlush
- StateManagers to processec
- ExecutionContext- Returns:
- Any optimistic verification exceptions thrown during flush
-
-