[jpa-spec users] [jsr338-experts] Re: StoredProcedure clarification

From: gordon yorke <>
Date: Tue, 06 Aug 2013 16:31:00 -0300

The practical thing to do for users in this case is to execute the
stored procedure but the specification does not define what should
happen if getUpdateCount() is called on an unexecuted StoredProcedureQuery.

On 26/07/2013 7: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, its a silly case, but the TCK does it. Many times...