-->
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.  [ 2 posts ] 
Author Message
 Post subject: XML session(EntityMode.DOM4J)
PostPosted: Mon Jul 11, 2005 5:29 am 
Newbie

Joined: Mon May 10, 2004 8:16 am
Posts: 6
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0.5


Code between sessionFactory.openSession() and session.close():
Session xmlSession = s.getSession(EntityMode.DOM4J);
Element nc = (Element)xmlSession.load(Nc.class, ncId);

Full stack trace of any exception that occurs:org.hibernate.WrongClassException: Object with id: 1191 was not of the specified subclass: Audit0 (loaded object was of wrong class)
at org.hibernate.loader.Loader.instanceAlreadyLoaded(Loader.java:890)
at org.hibernate.loader.Loader.getRow(Loader.java:846)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:305)
at org.hibernate.loader.Loader.doQuery(Loader.java:412)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1434)
at org.hibernate.loader.collection.OneToManyLoader.initialize(OneToManyLoader.java:111)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:488)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1430)
at org.hibernate.type.CollectionType.getCollection(CollectionType.java:484)



Name and version of the database you are using:
Oracle 10g


Bonjour,

Comment faire pour charger l'xml d'un objet persistant qui a déjà été chargé ? Il semble bloquer sur tous les fils qui ont déjà été chargés.
Changer le LockMode ne change rien.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 11, 2005 6:32 am 
Newbie

Joined: Mon May 10, 2004 8:16 am
Posts: 6
D'autant plus étonnant que la propriété est définie en lazy="true" et que je n'y accède jamais.
Le problème ne vient donc pas de là.

Quand je load le xml, tous les <set> sont chargés plusieurs fois, alors qu'ils sont en lazy="true", et que je n'ai pas défini de node pour qu'ils ne soient pas mis dans l'xml.
embed-xml="false" ne change rien.


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