Catching up on my email here (after a much-needed vacation), so please excuse the
delay in response....
On 7/26/2013 3:16 PM, Steve Ebersole wrote:
> EntityManager em = ...;
> StoredProcedureQuery query = em.createStoredProcedureQuery(...);
> query.getUpdateCount();
>
> What should happen above when getUpdateCount() is called? The "result" corollaries (getResultList, getSingleResult)
> specifically say that the query will be executed when they are called. getUpdateCount conspicuously says nothing on the
> subject. Nor does it call out being allowed to throw an exception in this case. So should I assume that getUpdateCount()
> should just return -1 here?
>
Yes. This is covered in section 3.10.17.3 of the spec. For some reason the
relevant statement didn't make it into the javadocs as with getResultList and
getSingleResult (although the spec version has it). I will track this as
an errata item.
-Linda
> Yes, its a silly case, but the TCK does it. Many times...
>
>