[hibernate-issues] [Hibernate-JIRA] Created: (EJB-439) Query.getSingleResult fails if a sored proc is used

Lloyd Fernandes (JIRA) noreply at atlassian.com
Mon May 18 18:22:13 EDT 2009


Query.getSingleResult fails if a sored proc is used
---------------------------------------------------

                 Key: EJB-439
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-439
             Project: Hibernate Entity Manager
          Issue Type: Bug
          Components: EntityManager
    Affects Versions: 3.4.0.GA
         Environment: Hibernate core 3.3.1
            Reporter: Lloyd Fernandes


If you use Query.getSingleResult() on a named query that results in a stored proce call, the query is changed from

{call usp_RequestState_Get (:requestID ) }

to

{call usp_RequestState_Get (? ) }

to

{call usp_Requ top 2estState_Get (? ) }  in (org.hibernate.loader.Loader.prepareQueryStatement() line 1557)


Code was working for 3.3.2

Looks like this was broken/incorrectly implemented earlier  (than 3.3.2) but exasperated by the recent change to org.hibernate.ejb.QueryImpl.getSingleResult()  that forces a maxResult to 2.

I think the correct fix will be to not insert the limit statement (Loader.java line 15557) if the sql query does not start with a select call or if it is marked callable

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list