title: Error while calling stored procedure using JPA
body: <p>I am trying to call an Oracle stored procedure using JPA EntityManager. The stored procedure returns a list of the orders joining multiple tables for a date range. The stored procedure works good when I test it at the database end. Below is my code to make the call</p>
  
  <pre><code>StoredProcedureQuery query = entityManager.createStoredProcedureQuery("Get_submitted_orders")
                  .registerStoredProcedureParameter(1, Class.class, ParameterMode.REF_CURSOR)
                  .registerStoredProcedureParameter(2, String.class, ParameterMode.IN)
                  .registerStoredProcedureParameter(3, Date.class, ParameterMode.IN)
                  .registerStoredProcedureParameter(4, Date.class, ParameterMode.IN)
                  .setParameter(2, storeCode)
                  .setParameter(3, fromDate, TemporalType.DATE)
                  .setParameter(4, toDate, TemporalType.DATE);
  
          List&lt;Object[]&gt; orders = query.getResultList();
  </code></pre>
  
  <p>Below is the error I am getting </p>
  
  <pre><code>Error calling CallableStatement.getMoreResults; nested exception is org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults
  </code></pre>