-->
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: Lazy loading problem when using session-per-request
PostPosted: Thu May 13, 2004 5:22 am 
Newbie

Joined: Mon Jan 05, 2004 10:46 am
Posts: 13
Hi,

I am constantly experience problems when trying to lazily load properties of an object.

My object overwrites equals and hashcode correctly. When I try to reassociate the object with the current session using LockMode.NONE I get a net.sf.hibernate.NonUniqueObjectException.

Correct is, that an Object of this type is already associated with the session, but because I have overwritten equals and hashcode Hibernate should know that this object is the same and not a different object?

Am I correct?

Code:
net.sf.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: 4926, of class: wilken.openshop.modules.base.bo.BusinessPartner
        at net.sf.hibernate.impl.SessionImpl.checkUniqueness(SessionImpl.java:1605)
        at net.sf.hibernate.impl.SessionImpl.reassociate(SessionImpl.java:1611)
        at net.sf.hibernate.impl.SessionImpl.lock(SessionImpl.java:1636)
        at org.springframework.orm.hibernate.HibernateTemplate$7.doInHibernate(HibernateTemplate.java:233)
        at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:150)
        at org.springframework.orm.hibernate.HibernateTemplate.lock(HibernateTemplate.java:231)


I inserted std out debug information into my equals and hashcode methods, but the messages never appear on std out, so I guess these methods never get called by Hibernate.

Any help greatly appreciated.

Best regards,

juergen


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.