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 Details

    • FlushNonReferential

      public FlushNonReferential()
  • Method Details

    • execute

      Description copied from interface: FlushProcess
      Execute the flush.
      Specified by:
      execute in interface FlushProcess
      Parameters:
      ec - ExecutionContext
      primarySMs - StateManagers that were made dirty by direct API calls. Cleared during this method
      secondarySMs - StateManagers that were made dirty by reachability. Cleared during this method
      opQueue - 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 process
      ec - ExecutionContext
      Returns:
      Any optimistic verification exceptions thrown during flush