docs: public void prepare(PersistentTransaction transaction) throws PersistenceException, SevereMessageStoreException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "prepare", "Transaction="+transaction);
  
          // Defect 363755
          if (!_available)
          {
              MessageStoreUnavailableException msue = new MessageStoreUnavailableException("Operation not possible as MessageStore is unavailable!");
              if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Operation not possible as MessageStore is unavailable!");
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare");
              throw msue;
          }
  
          //Get the task list from the transaction
          TaskList taskList = (TaskList) transaction.getWorkList();
  
          PersistentTranId       xid = transaction.getPersistentTranId();
          TransactionState tranState = transaction.getTransactionState();
          int          numberOfTasks = taskList.countLinks();
  
          boolean requiresSyncPersistence = false;
  
          // Defect 530772
          boolean requiresSpillPersistence = false;
  
          // Defect 298584
          // Batching context will only be created if we
          // have synchronous work to do.
          BatchingContext syncBatch = null;
          List             syncList = null;
  
          if (taskList.hasStoreAlways() || taskList.hasStoreEventually() || taskList.hasStoreMaybe())
          {
              // We have synchronous work to do so
              // we need to build up a list of tasks.
              Iterator iterator = taskList.iterator();
              while (iterator.hasNext())
              {
                  Operation          task = (Operation) iterator.next();
                  Persistable persistable = task.getPersistable();
  
                  // Defect 451518
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Preparing Task: "+task);
  
                  if (persistable != null && persistable.requiresPersistence())
                  {
                      int     storageStrategy = persistable.getStorageStrategy();
                      TupleTypeEnum tupleType = persistable.getTupleType();
  
                      // Feature SIB0112i.ms.1
                      // We only need to persist our synchronous work at this point. If our
                      // transaction prepares successfully then at commit time we can make
                      // sure our STORE_MAYBE work is persisted.
  
                      // Defect 530772
                      // Are we a STORE_MAYBE Item? If so then we can be dispatched to the
                      // spill dispatcher. If not then we need to be persisted synchronously.
                      // This is to avoid adding complication to the spill dispatcher as it
                      // does not worry about the order in which things are persisted so an
                      // Item on a stream can be hardened to disk before the stream. This will
                      // not work in the filestore case.
                      if (tupleType != TupleTypeEnum.ITEM_STREAM &&
                          tupleType != TupleTypeEnum.REFERENCE_STREAM &&
                          storageStrategy == AbstractItem.STORE_MAYBE)
                      {
                          if (requiresSpillPersistence == false)
                          {
                              requiresSpillPersistence = true;
                          }
                      }
                      // If not we are synchronous.
                      else
                      {
                          // Defect 298584
                          // Only create our batching context once we know for sure
                          // that we have some synchronous work to do.
                          if (requiresSyncPersistence == false)
                          {
                              syncList  = new ArrayList(numberOfTasks);
                              syncBatch = new BatchingContextImpl(_objectManager, _permanentStore, transaction);
                              transaction.setBatchingContext(syncBatch);
                              requiresSyncPersistence = true;
                          }
  
                          //Associate the global tran id with the persistable
                          persistable.setPersistentTranId(xid);
  
                          task.persist(syncBatch, tranState);
                          syncList.add(persistable);
                      }
                  }
              }
          }
  
  
          // Defect 530772
          // Check the health of the spill dispatcher to minimise the risk
          // of splitting a transaction.
          if (requiresSpillPersistence)
          {
              if (!_spillDispatcher.isHealthy())
              {
                  // Defect 345250
                  // The dispatcher is not currently accepting new work as it has
                  // hit a problem. Details of the problem should have been output
                  // to the logs by the dispatcher thread at the point where it
                  // occurred.
                  PersistenceException pe = new PersistenceException("SPILL_DISPATCHER_CANNOT_ACCEPT_WORK_SIMS1578");
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "The spill dispatcher cannot accept work!", pe);
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare");
                  throw pe;
              }
          }
  
          // Feature SIB0112i.ms.1
          // We only have to do some work in prepare if we have
          // synchronous work to add to the file store.
          if (requiresSyncPersistence)
          {
              try
              {
                  // As this is a prepare we use the addIndoubtXid()
                  // method to inform the batching context that we only
                  // wish to prepare during this executeUpdate() call.
                  syncBatch.addIndoubtXID(xid);
  
                  // Submit the batch and trigger the prepare in the
                  // object manager.
                  syncBatch.executeBatch();
  
                  // If we get to this point then the prepare was successful, so we need to
                  // notify the cache layer
                  Iterator iterator = syncList.iterator();
                  while (iterator.hasNext())
                  {
                      Tuple tuple = (Tuple)iterator.next();
  
                      // Both these methods need to be called to indicate to the cache
                      // that it can soften its in-memory reference to the persistable
                      tuple.persistableOperationBegun();
                      tuple.persistableOperationCompleted();
                  }
              }
              catch (PersistenceException pe)
              {
                  com.ibm.ws.ffdc.FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.prepare", "1:1615:1.81.1.6", this);
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Exception caught preparing transaction in object store!", pe);
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare");
                  throw pe;
              }
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "prepare");
      }