-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Don't miss: Correlation name 'this_' not found error
PostPosted: Thu Dec 13, 2007 10:30 am 
Newbie

Joined: Wed Oct 03, 2007 10:15 am
Posts: 5
Hibernate version:
3.2.5.ga

Debug level Hibernate log excerpt:

D 10:42:43:065 SchedulerServiceThread about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
D 10:42:43:065 SchedulerServiceThread opening JDBC connection
D 10:42:43:066 SchedulerServiceThread select attribute0_.ATTRID as ATTRID196_0_, attribute0_.VERSIONOPTLOCK as VERSIONO2_196_0_, attribute0_.COMPANY as COMPANY196_0_, attribute0_.APP as APP196_0_, attribute0_.SYS as SYS196_0_, attribute0_.ATTRNAME as ATTRNAME196_0_, attribute0_.ATTRVALUE as ATTRVALUE196_0_, case when attribute0_.SYS='LICENSING' and attribute0_.ATTRNAME='LICENSEKEY' then 'E' when attribute0_.SYS='LICENSING' and attribute0_.ATTRNAME='INSTALLDATE' then 'C' else 'P' end as clazz_0_ from IMATTRIBUTES attribute0_ where (this_.COMPANY=? and this_.APP=? and this_.SYS=? and this_.ATTRNAME=?)
D 10:42:43:066 SchedulerServiceThread preparing statement
D 10:42:43:185 SchedulerServiceThread could not execute query using scroll [select attribute0_.ATTRID as ATTRID196_0_, attribute0_.VERSIONOPTLOCK as VERSIONO2_196_0_, attribute0_.COMPANY as COMPANY196_0_, attribute0_.APP as APP196_0_, attribute0_.SYS as SYS196_0_, attribute0_.ATTRNAME as ATTRNAME196_0_, attribute0_.ATTRVALUE as ATTRVALUE196_0_, case when attribute0_.SYS='LICENSING' and attribute0_.ATTRNAME='LICENSEKEY' then 'E' when attribute0_.SYS='LICENSING' and attribute0_.ATTRNAME='INSTALLDATE' then 'C' else 'P' end as clazz_0_ from IMATTRIBUTES attribute0_ where (this_.COMPANY=? and this_.APP=? and this_.SYS=? and this_.ATTRNAME=?)]
java.sql.SQLException: [Sybase][ODBC Driver][Adaptive Server Anywhere]Correlation name 'this_' not found
at ianywhere.ml.jdbcodbc.IConnection.nativePrepareStatement(Native Method)
at ianywhere.ml.jdbcodbc.IConnection.prepareStatement(IConnection.java:328)
at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:275)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:491)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
at org.hibernate.loader.Loader.scroll(Loader.java:2292)
at org.hibernate.loader.criteria.CriteriaLoader.scroll(CriteriaLoader.java:89)
at org.hibernate.impl.SessionImpl.scroll(SessionImpl.java:1533)
at org.hibernate.impl.CriteriaImpl.scroll(CriteriaImpl.java:297)
at com.sync.db.AttributeMgrImpl.fetchAttributes(AttributeMgrImpl.java:88)
at com.sync.db.AttributeMgrImpl.getAttribute(AttributeMgrImpl.java:205)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sync.db.AccessMgr$Handler.invoke(AccessMgr.java:335)
at $Proxy1.getAttribute(Unknown Source)
at com.sync.scheduler.tasks.LogPurgeTask.getLastPurgeDate(LogPurgeTask.java:140)
at com.sync.scheduler.tasks.LogPurgeTask.isTimeToPurge(LogPurgeTask.java:210)
at com.sync.scheduler.tasks.LogPurgeTask.run(LogPurgeTask.java:395)
at com.sync.scheduler.tasks.LogPurgeTask.run(LogPurgeTask.java:422)
at com.sync.scheduler.ScheduledTask.runTaskUsingReflection(ScheduledTask.java:93)
at com.sync.scheduler.ScheduledTask.execute(ScheduledTask.java:69)
at com.sync.scheduler.SchedulerServiceThread.run(SchedulerServiceThread.java:117)
W 10:42:43:221 SchedulerServiceThread SQL Error: -142, SQLState: 42S02
E 10:42:43:221 SchedulerServiceThread [Sybase][ODBC Driver][Adaptive Server Anywhere]Correlation name 'this_' not found
E 10:42:43:222 SchedulerServiceThread fetchAttributes
org.hibernate.exception.SQLGrammarException: could not execute query using scroll
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.scroll(Loader.java:2328)
at org.hibernate.loader.criteria.CriteriaLoader.scroll(CriteriaLoader.java:89)
at org.hibernate.impl.SessionImpl.scroll(SessionImpl.java:1533)
at org.hibernate.impl.CriteriaImpl.scroll(CriteriaImpl.java:297)
at com.sync.db.AttributeMgrImpl.fetchAttributes(AttributeMgrImpl.java:88)
at com.sync.db.AttributeMgrImpl.getAttribute(AttributeMgrImpl.java:205)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sync.db.AccessMgr$Handler.invoke(AccessMgr.java:335)
at $Proxy1.getAttribute(Unknown Source)
at com.sync.scheduler.tasks.LogPurgeTask.getLastPurgeDate(LogPurgeTask.java:140)
at com.sync.scheduler.tasks.LogPurgeTask.isTimeToPurge(LogPurgeTask.java:210)
at com.sync.scheduler.tasks.LogPurgeTask.run(LogPurgeTask.java:395)
at com.sync.scheduler.tasks.LogPurgeTask.run(LogPurgeTask.java:422)
at com.sync.scheduler.ScheduledTask.runTaskUsingReflection(ScheduledTask.java:93)
at com.sync.scheduler.ScheduledTask.execute(ScheduledTask.java:69)
at com.sync.scheduler.SchedulerServiceThread.run(SchedulerServiceThread.java:117)
Caused by: java.sql.SQLException: [Sybase][ODBC Driver][Adaptive Server Anywhere]Correlation name 'this_' not found
at ianywhere.ml.jdbcodbc.IConnection.nativePrepareStatement(Native Method)
at ianywhere.ml.jdbcodbc.IConnection.prepareStatement(IConnection.java:328)
at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:275)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:491)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
at org.hibernate.loader.Loader.scroll(Loader.java:2292)
... 17 more



We have the a query that 99% of times runs perfectly, but after a while it starts to fail.
Look at the query's WHERE clause, suddenly 'this_' correlation name is being used in stead of 'attribute0_'.

Any one meet this error before?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 17, 2007 10:15 am 
Newbie

Joined: Wed Oct 03, 2007 10:15 am
Posts: 5
I have made the attributes bold, for a better view


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 17, 2007 11:36 am 
Newbie

Joined: Wed Oct 03, 2007 10:15 am
Posts: 5
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.sync.db.model.Attribute" table="IMATTRIBUTES" discriminator-value="P">
<id name="id" type="integer">
<column name="ATTRID" />
<generator class="com.sync.db.util.MobileSuiteKeyGenerator" />
</id>
<discriminator
type="character"
formula="case
when SYS='LICENSING' and ATTRNAME='LICENSEKEY' then 'E'
when SYS='LICENSING' and ATTRNAME='INSTALLDATE' then 'C'
else 'P' end"
/>
<version name="versionOptLock">
<column name="VERSIONOPTLOCK" default="0"/>
</version>
<property name="company" type="string">
<column name="COMPANY" not-null="true" />
</property>
<property name="app" type="string">
<column name="APP" not-null="true" />
</property>
<property name="sys" type="string">
<column name="SYS" not-null="true" />
</property>
<property name="attrname" type="string">
<column name="ATTRNAME" not-null="true" />
</property>
<!-- XXX length was 512 and is 2000 in create script -->
<property name="attrvalue" type="string">
<column name="ATTRVALUE" length="512" />
</property>
<subclass name="com.sync.db.model.License" discriminator-value="E"/>
<subclass name="com.sync.db.model.InstallDate" discriminator-value="C"/>
</class>
</hibernate-mapping>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.