private 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
                                       });
   
      // 531458 Allow minimal tracing to include message ids and tran id
      if (TraceComponent.isAnyTracingEnabled()) {
        CommsLightTrace.traceMessageIds(tc, "ReadAndDeleteSetMsgTrace", msgHandles);
      }
      
      SIBusMessage[] messages = null;
      
      CommsByteBuffer request = getCommsByteBuffer();
      
      request.putShort(getConnectionObjectID());
      request.putShort(getProxyID());
      request.putSITransaction(tran);            
      request.putSIMessageHandles(msgHandles);
      
      CommsByteBuffer reply = jfapExchange(request, 
                                           JFapChannelConstants.SEG_READ_AND_DELETE_SET,
                                           JFapChannelConstants.PRIORITY_MEDIUM,
                                           true);
      
      try
      {
         short err = reply.getCommandCompletionCode(JFapChannelConstants.SEG_READ_AND_DELETE_SET_R);
         if (err != CommsConstants.SI_NO_EXCEPTION)
         {
            checkFor_SISessionUnavailableException(reply, err);
            checkFor_SISessionDroppedException(reply, err);
            checkFor_SIConnectionUnavailableException(reply, err);
            checkFor_SIConnectionDroppedException(reply, err);
            checkFor_SIResourceException(reply, err);
            checkFor_SIConnectionLostException(reply, err);
            checkFor_SILimitExceededException(reply, err);
            checkFor_SIIncorrectCallException(reply, err);
            checkFor_SIMessageNotLockedException(reply, err);
            checkFor_SIErrorException(reply, err);
            defaultChecker(reply, err);
         }
         
         int numberOfMessages = reply.getInt();
         messages = new SIBusMessage[numberOfMessages];
         
         for (int x = 0; x < numberOfMessages; x++)
         {
            messages[x] = reply.getMessage(getCommsConnection());
         }
      }
      finally
      {
         reply.release(false);
      }
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "_readAndDeleteSet", messages);
      return messages;
   }
private 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 } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) ) { CommsLightTrace . traceMessageIds ( tc , "ReadAndDeleteSetMsgTrace" , msgHandles ) ; } SIBusMessage [ ] messages = null ; CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( getConnectionObjectID ( ) ) ; request . putShort ( getProxyID ( ) ) ; request . putSITransaction ( tran ) ; request . putSIMessageHandles ( msgHandles ) ; CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_READ_AND_DELETE_SET , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_READ_AND_DELETE_SET_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SISessionUnavailableException ( reply , err ) ; checkFor_SISessionDroppedException ( reply , err ) ; checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIResourceException ( reply , err ) ; checkFor_SIConnectionLostException ( reply , err ) ; checkFor_SILimitExceededException ( reply , err ) ; checkFor_SIIncorrectCallException ( reply , err ) ; checkFor_SIMessageNotLockedException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } int numberOfMessages = reply . getInt ( ) ; messages = new SIBusMessage [ numberOfMessages ] ; for ( int x = 0 ; x < numberOfMessages ; x ++ ) { messages [ x ] = reply . getMessage ( getCommsConnection ( ) ) ; } } finally { reply . release ( false ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "_readAndDeleteSet" , messages ) ; return messages ; }
Actually performs the read and delete.

@param msgHandles
@param tran

@return Returns the requested messages.

@throws SISessionUnavailableException
@throws SISessionDroppedException
@throws SIConnectionUnavailableException
@throws SIConnectionDroppedException
@throws SIResourceException
@throws SIConnectionLostException
@throws SILimitExceededException
@throws SIIncorrectCallException
@throws SIMessageNotLockedException
@throws SIErrorException