[hibernate-issues] [Hibernate-JIRA] Created: (HHH-7222) Hibernate creates aliases for HQL while submitting query to Oracle

Yogesh A Sakurikar (JIRA) noreply at atlassian.com
Wed Apr 4 03:32:50 EDT 2012


Hibernate creates aliases for HQL while submitting query to Oracle
------------------------------------------------------------------

                 Key: HHH-7222
                 URL: https://hibernate.onjira.com/browse/HHH-7222
             Project: Hibernate ORM
          Issue Type: Bug
          Components: query-hql
    Affects Versions: 3.0.5
         Environment: JBoss 5.1.0GA, Oracle 10g and 11g, Oracle jdbc driver 10.2
            Reporter: Yogesh A Sakurikar


Whenever we run HQL like shown below:
String query = "from xtable a, ytable b where a.xId = :xIdNum and a.xAcc = :xAccId and b.yAcc = a.xAcc and b.yKey = a.xKey "

The oracle creates each invocation of this query as new and executes it. As per the Oracle logs the number of parsing happened for this type of query is equal to the number of executions, which clearly suggest that every execution of the query has been treated as separate.
  
After we went into more details, we found out that the issue is related to the aliases being passed are different. Oracle was treating the query different as the aliases were different in each run.

Further more after going through lot of online reading, we found not much help, hence raising as an issue.

Kindly suggest us how we can avoid this as we are facing lot of production issues due to this.

Is there any way we can configure hibernate not to create new aliases for the same query?

Thanks in advance

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list