The JPA TCK has at least one assertion that calling StoredProcedureQuery#hasMoreResults immediately after calling StoredProcedureQuery#execute should be valid and that the TCK writers assume it is supposed to return the same result as the #hasMoreResults call.
But the spec is very clear. It says (section 3.10.17.3):
If the execute method returns true, the pending result set can be obtained by calling getResultList or getSingleResult. The hasMoreResults method can then be used to test for further results.
In other words, calling hasMoreResults tests for results beyond the first result (which is indicated by the execute return).
|