docs: public void itemReferencesDroppedToZero(SIMPMessage msg)
                      throws
                      SIRollbackException,
                      SIConnectionLostException,
                      SIIncorrectCallException,
                      SIResourceException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(tc, "itemReferencesDroppedToZero", msg);
  
          // Get the current transaction from the batchHandler under which to perform the remove
          BatchHandler batchHandler = _messageProcessor.getPublicationBatchHandler();
          TransactionCommon transaction = null;
  
          // If a COD report message is required, register the callback to send
          // the report. We don`t do this in the batch because the callback would
          // deadlock with the messageStore (190035)
          boolean batched = true;
          // A marker to indicate how far through the method we get.
          boolean messageAddCall = false;
  
          try
          {
              boolean localTransactionCreated = false;
              LocalTransaction localTransaction = null;
  
              if (msg.getReportCOD() != null)
              {
                  localTransaction = _baseDestinationHandler.
                                  getTransactionManager().
                                  createLocalTransaction(false);
                  transaction = localTransaction;
                  localTransactionCreated = true;
                  transaction.registerCallback(msg);
                  batched = false;
  
              }
              // TODO Until Message Store make their spilling logic sophisticated enough to realise
              // that spilling messages in 'remove' state is a little pointless we're better off removing
              // them immediately (don't batch them). This reduces the possibility of them being spilt.
              else if (((MessageItem) msg).getStorageStrategy() <= AbstractItem.STORE_MAYBE)
              {
                  transaction = _baseDestinationHandler.
                                  getTransactionManager().
                                  createAutoCommitTransaction();
                  batched = false;
              } else
              {
                  transaction = batchHandler.registerInBatch();
              }
  
              try
              {
                  // Remove the message from the topicspace
                  Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(transaction);
                  msg.remove(msTran, msg.getLockID());
  
                  if (localTransactionCreated)
                  {
                      localTransaction.commit();
                  }
  
                  // note that a batch listener could be added here for a callback when
                  // when the transaction commits
                  if (batched)
                  {
                      // Indicate that we have called the messagesAdded
                      messageAddCall = true;
                      batchHandler.messagesAdded(1);
                  }
              } catch (MessageStoreRuntimeException e)
              {
                  // No FFDC code needed
  
                  // This exception code should be removed when Message Store have updated to stop throwing exceptions
                  // if we try and remove a Best Effort message that has already been removed.
  
                  // This might be a StateException so we can ignore this if it is a best effort message
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                      SibTr.exception(tc, e);
  
                  // If this is a Best Effort message and it isn't in the store then that isn't
                  // a problem as it has already been removed.
                  if (msg.getReliability() != Reliability.BEST_EFFORT_NONPERSISTENT)
                  {
                      // FFDC
                      FFDCFilter.processException(
                                                  e,
                                                  "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.itemReferencesDroppedToZero",
                                                  "1:2432:1.35.2.4",
                                                  this);
  
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                          SibTr.exit(
                                     tc,
                                     "itemReferencesDroppedToZero",
                                     "MsgStoreRuntimeException " + e);
  
                      throw new SIErrorException(
                                      nls.getFormattedMessage(
                                                              "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                                              new Object[] {
                                                                            "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                                                            "1:2446:1.35.2.4",
                                                                            e,
                                                                            _baseDestinationHandler.getName() },
                                                              null),
                                      e);
                  }
              } catch (MessageStoreException e)
              {
                  FFDCFilter.processException(
                                              e,
                                              "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.itemReferencesDroppedToZero",
                                              "1:2457:1.35.2.4",
                                              this);
  
                  SibTr.exception(tc, e);
                  SibTr.error(
                              tc,
                              "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                              new Object[] {
                                            "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                            "1:2466:1.35.2.4",
                                            e,
                                            _baseDestinationHandler.getName() });
  
                  if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                      SibTr.exit(
                                 tc,
                                 "itemReferencesDroppedToZero",
                                 "ResourceException " + e);
  
                  throw new SIResourceException(
                                  nls.getFormattedMessage(
                                                          "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                                          new Object[] {
                                                                        "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                                                        "1:2481:1.35.2.4",
                                                                        e,
                                                                        _baseDestinationHandler.getName() },
                                                          null),
                                  e);
              }
          } finally
          {
              // Before exiting this method, need to unlock the batch handler if it was locked.
              if (batched && !messageAddCall)
                  try
                  {
                      batchHandler.messagesAdded(0);
                  } catch (SIResourceException e)
                  {
                      // No FFDC code needed, This will allow for any exceptions that were thrown to
                      // be rethrown instead of overiding with a batch handler error.
                      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                          SibTr.exception(tc, e);
                  }
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  SibTr.exit(
                             tc,
                             "itemReferencesDroppedToZero",
                             new Boolean(messageAddCall));
          }
      }