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^
|