title: camel-mybatis - issues with calling Oracle Stored procedure with multiple resultsets
body: <p>I am using camel-mybatis (version 2.12) component in Fuse 6.1 environment to invoke an oracle SP with 2 resultsets. The request is a HashMap and once mybatis maps the resultsets to java beans, the List is again saved in the original HashMap itself. </p>
  
  <p>Here is the snippet of SqlMap:</p>
  
  <pre><code>&lt;select
      id="searchUsers"
      parameterType="java.util.HashMap"       
      statementType="CALLABLE"&gt;
      {call ORACLE.SP_NAME_1(
          #{userId,mode=IN,jdbcType=VARCHAR},
    #{maxResultsCount,mode=IN,jdbcType=DECIMAL},
    #{view,mode=IN,jdbcType=VARCHAR},
    #{statusInfo,mode=OUT,jdbcType=CURSOR,resultMap=statusInfoRowMap},
    #{memberInfo,mode=OUT,jdbcType=CURSOR,resultMap=claimInfoRowMap})}
  </code></pre>
  
  <p>And here is how I invoke the mybatis component:</p>
  
  <pre><code>&lt;setBody&gt;
      &lt;groovy&gt;
  [
      userId:'ID-1234',
      maxResultsCount:20,
      view:'MEMBER',
  ]
     &lt;/groovy&gt;
  &lt;/setBody&gt;
  &lt;to uri="mybatis:searchUsers?statementType=SelectOne" /&gt;
  </code></pre>
  
  <p>Since there are no result object (all the results are stored in the original requested HashMap itself), MyBatisProducer is setting null to exchange OUT message. The original body which contains the results from stored procedure is lost.</p>
  
  <p>The Question is: is this the expected behaviour? mybatis component already stores the result in exchange header, so why to update the body as well?</p>
  
  <p>The workaround I had to do was - to store the original body to a header, invoke mybatis and reset body from the header (which has the stored procedure result now) : </p>
  
  <pre><code>&lt;setBody&gt;
              &lt;groovy&gt;
                  [
               userId:'ID1234',
               maxResultsCount:20,
               view:'MEMBER'
            ]
          &lt;/groovy&gt;
      &lt;/setBody&gt;
      &lt;setHeader headerName="originalRequest"&gt;
          &lt;simple&gt;${body}&lt;/simple&gt;
      &lt;/setHeader&gt;
      &lt;to uri="mybatis:searchUsers?statementType=SelectOne" /&gt;
      &lt;setBody&gt;
          &lt;simple&gt;${in.headers.originalRequest}&lt;/simple&gt;
      &lt;/setBody&gt;
      &lt;log message="status: ${body[statusInfo]}" /&gt;
  </code></pre>
  
  <p>Any help would be appreciated.. Thanks.</p>