-->
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.  [ 12 posts ] 
Author Message
 Post subject: I'm downgrading back to 2.1.6 form 3.x
PostPosted: Mon Sep 26, 2005 12:58 pm 
Regular
Regular

Joined: Thu Aug 19, 2004 9:28 am
Posts: 63
Sorry guys but my attempts to upgrade to 3.0.5 and 3.1 beta3 failed.

I needed to upgrade to get the new "Case When" functionnality implemented in H3 but the pain that it's causing me is to much.

Here's why:

1- After upgrading all my HQL that uses *= for outer join stopped working. I tried using the "org.hibernate.hql.classic.ClassicQueryTranslatorFactory" instead of the new one (can't remember the class name) but that's causing me an other headache (see point 2).

2- When using "org.hibernate.hql.classic.ClassicQueryTranslatorFactory", my session.SaveOrUpdate, that use to work prior to upgrading, are failing (works to update objects but not to create new ones). To resolve that problem I would need to add the table hbm.xml file name to the call (session.SaveOrUpdate("hbm.xml file name", myNewObj))

3- I tried upgrading to h3.1 beta 3 but that's not solving any of my problems.

4- I posted and posted an posted again and never got any replies. I even tried sending an email to Emmanual (Paris) but without success (might be out of town or something). I searched the web with Google to only find that other people have the same issues but no real solution.

Her's my postings:

http://forum.hibernate.org/viewtopic.php?t=947952
http://forum.hibernate.org/viewtopic.php?t=947912
http://forum.hibernate.org/viewtopic.php?t=935652

Anyhow, I didn't mean to bitch too much but I guess I did :). I'm just frustrated right now. Don't worry, I'll come down.


Cheers.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 2:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
#1 HQL does not have a *= operator.

#2 Why are you using ClassicQueryTranslatorFactory

#3 you dont explain your problem

#4 all your posts does not list any of the above issues and all answerable postings were answered to the best extent possible.

but I'm sorry to hear you have had issues, but please read
http://www.hibernate.org/ForumMailingli ... AskForHelp

and realise that you are using a not-so-used db as far as I can tell; doesnt sybase support ansi joins by now ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 2:20 pm 
Regular
Regular

Joined: Thu Aug 19, 2004 9:28 am
Posts: 63
Thanks for your reply Max.

Sorry if I sound alarming. I agree about your statement concerning Sybase. They might migrate to MSSQL in a year or two but until then, I'm stuck with it

If you have time, we could go over my issues oine at a time :).

Could you please take a look at this posting and help me figure this one out:

http://forum.hibernate.org/viewtopic.php?t=947912.

Let me know if you need more details.

p.s.: If you could explain to me under which situation H3 requires the mapping file name of the object I'm trying to save (new object to be persisted).

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 2:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
H3 never *requires* using a specifc entity name when calling the session methods. The only place where it might be necessary is when you are using a different entitymode or have mapped the same *class* in more than one way.

And the forum you refer to seem to indicate either a bug in the usage or in the underlying data. The entity name should never be able to be empty.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 3:02 pm 
Regular
Regular

Joined: Thu Aug 19, 2004 9:28 am
Posts: 63
Thanks Max,


I put my code back the way it was (no mapping filename supplied to the SaveOrUpdate) and I still can't save a new object instance.


I did a full text search in all my libraries and there's no mention of the entitymode anywhere so that's not the issue.

The object class I'm trying to save is only define once. I also did a full text search for that class name and only found it in it's own hbm.xml and in one association in another hbm.xml file.

The issue did not exist when I was using h2.1.6. Now, everywhere I try to save a newly created object (not only with ApplExpertise), I get the same error (see error stack below).

Here the code I'm talking about:

hibernate.ApplExpertise myApplExpertise = new hibernate.ApplExpertise(this.applId);

// Save to DB
session.saveOrUpdate(myApplExpertise);
session.flush();
session.refresh(myApplExpertise);

The error stack's generated when "session.saveOrUpdate(myApplExpertise);" is called.


Error stack:


org.hibernate.MappingException: Unknown entity:

at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:648)

at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1215)

at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:180)

at org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:459)

at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:84)

at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)

at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:500)

at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:494)

at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:490)

at ca.sshrc.web.forms.beans.programs.ResearchActivityBean.save(ResearchActivityBean.java:1862)

at ca.sshrc.web.common.services.CommonAction.save(CommonAction.java:205)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)

at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)

at javax.faces.component.UICommand.broadcast(UICommand.java:312)

at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)

at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)

at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at ca.sshrc.web.common.services.filters.GZIPFilter.doFilter(GZIPFilter.java:20)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at ca.sshrc.web.common.services.filters.NavigationFilter.doFilter(NavigationFilter.java:124)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at ca.sshrc.web.common.services.filters.SessionExpiredFilter.doFilter(SessionExpiredFilter.java:91)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)

at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)

at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)

at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)

at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

at java.lang.Thread.run(Thread.java:534)



Mapping for ApplExpertise:

<?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>
<!--
Created by the Middlegen Hibernate plugin
http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->
<class name="hibernate.ApplExpertise" table="APPL_EXPERTISE">
<id name="applId" type="java.lang.Integer" column="Appl_ID">
<generator class="assigned"/>
</id>
<property name="keywords" type="java.lang.String" column="Keywords" length="255"/>
<property name="disciplineCode1" type="java.lang.Integer" column="Discipline_Code_1" length="5"/>
<property name="otherDisciplineName1" type="java.lang.String" column="Other_Discipline_Name_1" length="40"/>
<property name="disciplineCode2" type="java.lang.Integer" column="Discipline_Code_2" length="5"/>
<property name="otherDisciplineName2" type="java.lang.String" column="Other_Discipline_Name_2" length="40"/>
<property name="disciplineCode3" type="java.lang.Integer" column="Discipline_Code_3" length="5"/>
<property name="otherDisciplineName3" type="java.lang.String" column="Other_Discipline_Name_3" length="40"/>
<property name="disciplineCode4" type="java.lang.Integer" column="Discipline_Code_4" length="5"/>
<property name="otherDisciplineName4" type="java.lang.String" column="Other_Discipline_Name_4" length="40"/>
<property name="disciplineCode5" type="java.lang.Integer" column="Discipline_Code_5" length="5"/>
<property name="otherDisciplineName5" type="java.lang.String" column="Other_Discipline_Name_5" length="40"/>
<property name="areaOfResearchCode1" type="java.lang.Integer" column="Area_Of_Research_Code_1" length="4"/>
<property name="areaOfResearchCode2" type="java.lang.Integer" column="Area_Of_Research_Code_2" length="4"/>
<property name="areaOfResearchCode3" type="java.lang.Integer" column="Area_Of_Research_Code_3" length="4"/>
<property name="geoPoliticalCode1" type="java.lang.Integer" column="GeoPolitical_Code_1" length="4"/>
<property name="geoPoliticalCode2" type="java.lang.Integer" column="GeoPolitical_Code_2" length="4"/>
<property name="geoPoliticalCode3" type="java.lang.Integer" column="GeoPolitical_Code_3" length="4"/>
<property name="countryCode1" type="java.lang.Integer" column="Country_Code_1" length="5"/>
<property name="provinceStateCode1" type="java.lang.String" column="Province_State_Code_1" length="2"/>
<property name="countryCode2" type="java.lang.Integer" column="Country_Code_2" length="5"/>
<property name="provinceStateCode2" type="java.lang.String" column="Province_State_Code_2" length="2"/>
<property name="countryCode3" type="java.lang.Integer" column="Country_Code_3" length="5"/>
<property name="provinceStateCode3" type="java.lang.String" column="Province_State_Code_3" length="2"/>
<property name="countryCode4" type="java.lang.Integer" column="Country_Code_4" length="5"/>
<property name="provinceStateCode4" type="java.lang.String" column="Province_State_Code_4" length="2"/>
<property name="countryCode5" type="java.lang.Integer" column="Country_Code_5" length="5"/>
<property name="provinceStateCode5" type="java.lang.String" column="Province_State_Code_5" length="2"/>
<property name="temporalStartYear1" type="java.lang.Integer" column="Temporal_Start_Year_1" length="10"/>
<property name="temporalStartBcAd1" type="java.lang.String" column="Temporal_Start_BC_AD_1" length="2"/>
<property name="temporalEndYear1" type="java.lang.Integer" column="Temporal_End_Year_1" length="10"/>
<property name="temporalEndBcAd1" type="java.lang.String" column="Temporal_End_BC_AD_1" length="2"/>
<property name="temporalStartYear2" type="java.lang.Integer" column="Temporal_Start_Year_2" length="10"/>
<property name="temporalStartBcAd2" type="java.lang.String" column="Temporal_Start_BC_AD_2" length="2"/>
<property name="temporalEndYear2" type="java.lang.Integer" column="Temporal_End_Year_2" length="10"/>
<property name="temporalEndBcAd2" type="java.lang.String" column="Temporal_End_BC_AD_2" length="2"/>
<property name="humanSubjectResearchInd" type="java.lang.String" column="Human_Subject_Research_Ind" length="1"/>
<property name="createDate" type="java.sql.Timestamp" column="Create_Date" length="23" insert="false" update="false"/>
<property name="createUserId" type="java.lang.String" column="Create_User_ID" length="3" update="false" insert="false"/>
<property name="changeDate" type="java.sql.Timestamp" column="Change_Date" length="23" insert="false" update="false"/>
<property name="changeUserId" type="java.lang.String" column="Change_User_ID" length="3" insert="false" update="false"/>
<property name="environmentalAssessmentInd" type="java.lang.String" column="Environmental_Assessment_Ind" length="1"/>
<!-- associations -->
</class>
</hibernate-mapping>




Any pointers will be greatly appreciated.Thanks Max.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 3:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the only thing i can say is that hibernate core is trying to find a entity persister with a blank name - that should not happen.

I would put a breakpoint at SessionFactoryImpl.java:648 and see when a unknown entity comes by - try that and see what happens.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 12:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
are you by any chance using an interceptor?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 7:45 am 
Regular
Regular

Joined: Thu Aug 19, 2004 9:28 am
Posts: 63
steve wrote:
are you by any chance using an interceptor?



Yes I do use an interceptor. Why?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 8:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
what does your implementation of Interceptor.getEntityName() look like?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 8:37 am 
Regular
Regular

Joined: Thu Aug 19, 2004 9:28 am
Posts: 63
steve wrote:
what does your implementation of Interceptor.getEntityName() look like?


Whoops! I guess that would do it :)

public String getEntityName(Object object) throws CallbackException {
return "";
}

Would you mind telling me what I should put in there?


I implemented the interceptor because I need one of my update statement to be sent to the DB even if the value (a status column) doesn't change. I need that because a trigger on that table must be executed even if that value is not changed.

For example, Update Form.Status='N' where Form.FormId = 123456;

Is there another way to do this without using an interceptor? If so, could you tell me how? I'd rather not have an interceptor.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 8:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
return null; would be a much better choice....or simply let your interceptor extends EmptyInterceptor

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 9:59 am 
Regular
Regular

Joined: Thu Aug 19, 2004 9:28 am
Posts: 63
max wrote:
return null; would be a much better choice....or simply let your interceptor extends EmptyInterceptor


Great, I extended my interceptor with the emptyInterceptor and it solved my problem. Thx.

Now, would you mind telling me anything you know about the "Select ... more than one column having same name" problem I'm experiencing. I know it's a "stupid" Sybase restriction but like I said earlier, I'm stuck with it.

The query I'm doing is accessing many tables (about 5) and two of them have the same primary key column name(org_id). For some reasons, H3 generates the same alias for those two columns and Sybase doesn't like that (stupid Sybase :P).


See last few post of thread http://forum.hibernate.org/viewtopic.php?t=935652.


My DB version: ASE 12.0.1


Cheers


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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.