-->
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.  [ 1 post ] 
Author Message
 Post subject: UnresolvableObjectException: No row with the given identifie
PostPosted: Wed Jan 19, 2005 11:19 pm 
Newbie

Joined: Tue Jan 18, 2005 6:19 am
Posts: 3
Hibernate version:
2.1.6
Mapping documents:(parts)
<class name="TblDir" table="tbl_dir">
<cache usage="read-write"/>

<id
column="dir_id"
name="id"
type="integer"
>
<generator class="vm" />
</id>
...
<many-to-one
class="TblDir"
name="upDir"
not-null="false"
>
<column name="up_dir" />
</many-to-one>
<many-to-one
class="TblUser"
name="account"
not-null="true"
>
<column name="account" />
</many-to-one>
<set inverse="true" name="set" cascade="delete">
<cache usage="read-write"/>
<key column="up_dir" />
<one-to-many class="TblDir" />
</set>
<set inverse="true" name="tblFileInfoSet" cascade="delete">
<cache usage="read-write"/>
<key column="dir_id" />
<one-to-many class="TblFileInfo" />
</set>
</class>
Code between sessionFactory.openSession() and session.close():
try
{
s = getSession();
Query query;
query = s.createQuery("from TblDir as dir where dir.account = ? and dir.upDir > 1");

List list = query.list();
if (list != null && list.size() > 0)
{
dir = (TblDir) list.get(0);
}
else
{
throw new HibernateException("could not found the root path of user.");
}
}
finally
{
closeSession(s);
}
Full stack trace of any exception that occurs:
[16:21:17][File][192.168.172.15][test_sp1]:No row with the given identifier exists: -1979788177, of class: com.abc.def.hb.TblFileInfo
net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: -1979788177, of class: com.abc.def.hb.TblFileInfo
at net.sf.hibernate.UnresolvableObjectException.throwIfNull(UnresolvableObjectException.java:38)
at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1954)
at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:69)
at net.sf.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:108)
at net.sf.hibernate.collection.Set.initializeFromCache(Set.java:92)
at net.sf.hibernate.impl.SessionImpl.initializeCollectionFromCache(SessionImpl.java:3963)
at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:3262)
at net.sf.hibernate.collection.PersistentCollection.forceInitialization(PersistentCollection.java:336)
at net.sf.hibernate.impl.SessionImpl.initializeNonLazyCollections(SessionImpl.java:3123)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1544)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.abc.def.hb.dao.TblDirDAO.getRootPath(TblDirDAO.java:60)
at com.abc.def.file.DirAction.doListPath(DirAction.java:193)
Name and version of the database you are using:
sql server 2000 enterprise

The exception happened query afer a delete execute.
I used ehcache.All work fine if I remove ehcache.
Who can help me?Thank you very much.
I waiting on line.

^O^


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

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.