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: Looking at Migrating from 3.1 to 3.2 - "not-found"
PostPosted: Tue Oct 03, 2006 3:04 am 
Newbie

Joined: Tue Oct 03, 2006 2:57 am
Posts: 4
Hi there,

We have a system in production which uses Hibernate 3.1.3.

Owing to the legacy data model, a number of our mapped many-to-one columns are often not found in the foreign table.

With 3.1.3 the "not-found" attribute in the many-to-one element stopped Hibernate from blowing up when the FK was dangling/didn't point to an instance in the foreign table. Everything works hunky dory.

I've just swapped out 3.1.3 with the latest 3.2 release candidate and have kept everything as is. I tried to run a few test cases, and am seeing the following exception being thrown when a FK column is null and hence doesn't resolve.

Without spending all night trying to find my way thru the source to find out what's going on:

1) is anyone else using not-found in many-to-one with 3.2? If so - all OK with you?

2) it looks like there's an "EntityNotFoundDelegate" which has been introduced into the codebase. Do I need to prod this somehow/implement a custom delegate to deal with non-existant/dangling FK relationships such as the one in the exception below?

Any advice appreciated!!

JC



Code:
org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [com.foo.domain.Office#OfficeCode / null]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.foo.domain.Office#OfficeCode / null]org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.foo.domain.Office#OfficeCode / null] at org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:375) at org.hibernate.event.def.DefaultLoadEventListener.returnNarrowedProxy(DefaultLoadEventListener.java:221) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:185) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:101) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878) at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) at org.hibernate.type.EntityType.resolve(EntityType.java:303) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842) at org.hibernate.loader.Loader.doQuery(Loader.java:717) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2144) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028) at org.hibernate.loader.Loader.list(Loader.java:2023) at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569) at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283) at org.springframework.orm.hibernate3.HibernateTemplate$37.doInHibernate(HibernateTemplate.java:988) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366) at org.springframework.orm.hibernate3.HibernateTemplate.findByCriteria(HibernateTemplate.java:978) at org.springframework.orm.hibernate3.HibernateTemplate.findByCriteria(HibernateTemplate.java:971) at com.foo.db.dao.hibernate.HibernatePlanDAO.findByGsIds(HibernatePlanDAO.java:78) at com.foo.db.dao.hibernate.HibernatePlanDAOTest.testFindByGsIds(HibernatePlanDAOTest.java:66)
[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 8:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if you can boil it down to a simple testcase that works in 3.1.x and fails on 3.2.x then it would be good if you could report it in our jira.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 11:40 am 
Newbie

Joined: Tue Oct 03, 2006 2:57 am
Posts: 4
Hi Max,

I will get on this today and report back here.

Thank you

JC


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.