docs: public SIBusMessage[] readAndDeleteSet(SIMessageHandle[] msgHandles, SITransaction tran)
        throws SISessionUnavailableException, SISessionDroppedException,
               SIConnectionUnavailableException, SIConnectionDroppedException,
               SIResourceException, SIConnectionLostException, SILimitExceededException,
               SIIncorrectCallException, SIMessageNotLockedException, 
               SIErrorException
     {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "readAndDeleteSet",
                                             new Object[] 
                                             {
                                                msgHandles.length + " msg ids",
                                                tran
                                             });
  
        SIBusMessage[] messages = null;
        
        try
        {
           closeLock.readLock().lockInterruptibly();
           
           try
           {
              checkAlreadyClosed();
              
              // Now we need to synchronise on the transaction object if there is one.
              if (tran != null)
              {
                 synchronized (tran)
                 {
                    // Check transaction is in a valid state.
                    // Enlisted for an XA UOW and not rolledback or
                    // completed for a local transaction.
                    if (!((Transaction) tran).isValid())
                    {
                       throw new SIIncorrectCallException(
                          nls.getFormattedMessage("TRANSACTION_COMPLETE_SICO1066", null, null)
                       );
                    }
                    
                    messages = _readAndDeleteSet(msgHandles, tran);
                 }
              }
              else
              {
                 messages = _readAndDeleteSet(msgHandles, null);
              }
           }
           finally
           {
              closeLock.readLock().unlock();
           }
        }
        catch (InterruptedException e)
        {
           // No FFDC Code needed
        }
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "readAndDeleteSet");
        return messages;
     }