2012-08-14 4 views
1

다음과 같은 문제점으로 WebSphere 큐를 업데이트하려고합니다. _outPutQueue.Put() 메소드가 호출되면 MQ 예외가 발생하고 " MQRC_FUNCTION_NOT_SUPPORTED. " 이것은 (CommittableTransaction) 블록을 사용하여 메서드 호출을 래핑했기 때문에 발생합니다. 블록 밖에서 메서드 호출을하면 잘 동작합니다. 이것은 단순히 C# 내의 대기열에 쓰는 한계입니까? 여기에 요청 된 전체 예외 정보이므로WebSphere MQ 큐 원자 업데이트를 시도하는 중

using (CommittableTransaction transScope = new CommittableTransaction()) 
{ 
     CommittableTransaction.Current = transScope; 


     try 
     {       

      foreach (string agentItem in qSqlContents.Values) 
      { 
       // Define a WebSphere MQ message, writing some text in UTF format 
       MQMessage mqMessage = new MQMessage(); 
       mqMessage.Write(StrToByteArray(agentItem)); 

       // Specify the message options 
       MQPutMessageOptions pmo = new MQPutMessageOptions(); 

       // MQC.MQPMO_SYNCPOINT = provide transaction support for the Put. 
       pmo.Options = MQC.MQPMO_SYNCPOINT; 

       // Put the message on the queue 
       _outputQueue.Put(mqMessage, pmo); 
      }      
     } 
     catch (Exception) 
     { 
      transScope.Rollback();       
     } 
     finally 
     { 
      transScope.Commit();       
     } 
} 

:

MQRC_FUNCTION_NOT_SUPPORTED 
Exception | System.Exception 
    base {object} | object 
Non-Public members | 
    _COMPlusExceptionCode = -532459699 

답변

0

이보십시오,이 반드시이 문제가 해결됩니다 일반적으로 100 %에서 물건을 빠르게하는 몇 개조하면 되겠 어이 있지만, 진단에 도움이 될 수 있습니다 ...

// Specify the message options 
MQPutMessageOptions pmo = new MQPutMessageOptions(); 

// MQC.MQPMO_SYNCPOINT = provide transaction support for the Put. 
pmo.Options = MQC.MQPMO_SYNCPOINT; 
CommittableTransaction transScope = new CommittableTransaction(); 
CommittableTransaction.Current = transScope;  

try 
{        
    foreach (string agentItem in qSqlContents.Values) 
    { 
     // Define a WebSphere MQ message, writing some text in UTF format 
     MQMessage mqMessage = new MQMessage(); 
     mqMessage.Write(StrToByteArray(agentItem)); 

     // Put the message on the queue 
     _outputQueue.Put(mqMessage, pmo); 
    }      
} 
catch (Exception) 
{ 
    transScope.Rollback();       
} 
finally 
{ 
    _outputQueue.close(); 
    transScope.Commit(); 
    transScope.Dispose();      
} 
+0

불행히도 정확한 오류가 발생했습니다. – NealR

+0

나는이 문제점이 발생하는 이유를 테스트하기 위해 내 컴퓨터를 가지고 있지 않다. 위의 업데이트 된 코드를 사용해 볼 수 있습니까? 오류를 일으키는 outputQueue.Put의 첫 번째 실행인지, 두 번째인지, 세 번째인지 등을 확인하고 알려주십시오. 바라기를 이것은 당신의 문제점을 그러나 해결할 것이다. 문을 사용하여 어쨌든 객체에 dispose를 호출하면 ... – Faraday

+0

_outputQueue.Put()이 처음 호출 될 때 예외를 throw하고 복사 (복사 및 붙여 넣기) 만하면됩니다. 루프는 두 번째 반복을 수행하지 않습니다. – NealR