docs: public void commit(PersistentTransaction transaction, boolean onePhase) throws PersistenceException, SevereMessageStoreException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "commit", new Object[]{"Transaction="+transaction, "OnePhase="+onePhase});
  
          // 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, "commit");
              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;
          boolean requiresSpillPersistence = false;
  
          BatchingContext  syncBatch = null;
  
          List         syncList = null;
          List        spillList = null;
  
          if (onePhase)
          {
              // In a one-phase commit we need to check for
              // STORE_ALWAYS,STORE_EVENTUALLY and STORE_MAYBE
              // all at the same time as everything is handled
              // in a single phase.
              if (taskList.hasStoreAlways() || taskList.hasStoreEventually() || taskList.hasStoreMaybe())
              {
                  // Scan through the list finding out what kind of persistence we need.
                  // This pass will build up lists of our synchronous work and possible
                  // spill work.
                  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, "Committing Task(1PC): "+task);
  
                      if (persistable != null && persistable.requiresPersistence())
                      {
                          int     storageStrategy = persistable.getStorageStrategy();
                          TupleTypeEnum tupleType = persistable.getTupleType();
  
                          // Feature SIB0112i.ms.1
                          // Are we a STORE_MAYBE Item? If so then we can be directly added to the
                          // temporary store. This allows the ObjectManager to manage the time at
                          // which the transaction data is written to the temporary store (usually
                          // at the next available checkpoint) and removes the need for the spill
                          // dispatcher.
                          if (tupleType != TupleTypeEnum.ITEM_STREAM &&
                              tupleType != TupleTypeEnum.REFERENCE_STREAM &&
                              storageStrategy == AbstractItem.STORE_MAYBE)
                          {
                              // Feature SIB0112i.ms.1
                              if (requiresSpillPersistence == false)
                              {
                                  spillList  = new ArrayList(numberOfTasks);
                                  requiresSpillPersistence = true;
                              }
  
                              // Defect 530772
                              // Add the task to the list we will pass
                              // to the dispatcher.
                              spillList.add(task);
                          }
                          // 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);
                                  requiresSyncPersistence = true;
                              }
  
                              task.persist(syncBatch, tranState);
                              syncList.add(persistable);
                          }
                      }
                  }
              }
          }
          //two-phase commit
          else
          {
              if (taskList.hasStoreAlways() || taskList.hasStoreEventually() || taskList.hasStoreMaybe())
              {
                  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, "Committing Task(2PC): "+task);
  
                      if (persistable != null && persistable.requiresPersistence())
                      {
                          int     storageStrategy = persistable.getStorageStrategy();
                          TupleTypeEnum tupleType = persistable.getTupleType();
  
                          // Feature SIB0112i.ms.1
                          // Are we a STORE_MAYBE Item? If so then we can be directly added to the
                          // temporary store. This allows the ObjectManager to manage the time at
                          // which the tramnsaction data is written to the temporary store (usually
                          // at the next available checkpoint) and removes the need for the spill
                          // dispatcher.
                          if (tupleType != TupleTypeEnum.ITEM_STREAM &&
                              tupleType != TupleTypeEnum.REFERENCE_STREAM &&
                              storageStrategy == AbstractItem.STORE_MAYBE)
                          {
                              // Feature SIB0112i.ms.1
                              // If we have some STORE_MAYBE work to do then
                              // we can now add it to the file store's
                              // temporary store.
                              if (requiresSpillPersistence == false)
                              {
                                  spillList  = new ArrayList(numberOfTasks);
                                  requiresSpillPersistence = true;
                              }
  
                              // Defect 530772
                              // Add the task to the list we will pass
                              // to the dispatcher.
                              spillList.add(task);
                          }
                          // If not we are synchronous.
                          else
                          {
                              // Defect 298584
                              // We only need to check on our batching context once
                              // we know that we have some synchronous work from
                              // the first phase that needs completing.
                              if (requiresSyncPersistence == false)
                              {
                                  // Get the batching context for this two-phase operation.
                                  // One must exist from the prepare phase if it does not
                                  // then we need to check if this transaction has been
                                  // recovered or not.
                                  syncBatch = transaction.getBatchingContext();
                                  if (syncBatch == null)
                                  {
                                      // We need to see if this is the second phase of
                                      // a recovered indoubt transaction if not we can
                                      // throw an exception.
                                      Transaction tran = null;
                                      try
                                      {
                                          tran = _objectManager.getTransactionByXID(xid.toByteArray());
                                      }
                                      catch (ObjectManagerException ome)
                                      {
                                          com.ibm.ws.ffdc.FFDCFilter.processException(ome, "com.ibm.ws.sib.msgstore.persistence.objectManager.PersistableMessageStoreImpl.commit", "1:1800:1.81.1.6", this);
                                          if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Exception caught requesting recovered transaction from object manager!", ome);
                                          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
                                          throw new PersistenceException("Exception caught requesting recovered transaction from object manager: "+ome.getMessage(), ome);
                                      }
  
                                      if (tran != null)
                                      {
                                          // We are completing an indoubt so we need to
                                          // create a batching context to use.
                                          syncBatch = new BatchingContextImpl(_objectManager, _permanentStore, tran);
                                          transaction.setBatchingContext(syncBatch);
                                      }
                                      else
                                      {
                                          PersistenceException pe = new PersistenceException("No existing batching context found during two-phase commit!");
                                          if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "No existing batching context found during two-phase commit!", pe);
                                          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
                                          throw pe;
                                      }
                                  }
                                  requiresSyncPersistence = true;
                              }
                          }
                      }
                  }
              }
          }
  
          // 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;
              }
          }
  
          if (requiresSyncPersistence)
          {
              try
              {
                  // Tell the batch that we need to commit during the
                  // next executeBatch call.
                  syncBatch.updateXIDToCommitted(null);
  
                  //Submit the batch
                  syncBatch.executeBatch();
  
                  // If we are one-phase then we need to inform the cache
                  // layer of the successful writes. If we are two-phase
                  // this will have been done at prepare time.
                  if (onePhase)
                  {
                      //If we get to this point then the commit 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.commit", "1:1880:1.81.1.6", this);
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Exception caught committing transaction work in permanent store!", pe);
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
                  throw pe;
              }
          }
  
          // Defect 530772
          // Always submit any spill updates to the dispatcher for processing.
          if (requiresSpillPersistence)
          {
              _spillDispatcher.dispatch(spillList, transaction, false);
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
      }