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.  [ 4 posts ] 
Author Message
 Post subject: illegally attempted to associate a proxy with two open Sess.
PostPosted: Wed Dec 05, 2007 1:32 am 
Newbie

Joined: Thu Mar 22, 2007 12:48 am
Posts: 7
Location: Delhi
Hi,

this is very long time to post here,

i'm facing error while updating a custom class(pojo) object with update method of hibernate session.

I explain you structure of all classes.
I have an Engine which made by 10-20 classes to calculate data. I get a new session when entering in engine and after that i maintain that session through out the engine, i found at a particular class i again create a new session(by mistake) which is not required.If remove the code for creating new session in that particular class the engine working fine.

Please explain why the following error comes

Thank you for your guidance.

Error are as follow

error:org.hibernate.HibernateException: illegally attempted to associate a proxy with two open Sessions
at org.hibernate.proxy.AbstractLazyInitializer.setSession(AbstractLazyInitializer.java:68)
at org.hibernate.engine.PersistenceContext.reassociateProxy(PersistenceContext.java:520)
at org.hibernate.engine.PersistenceContext.reassociateIfUninitializedProxy(PersistenceContext.java:486)
at org.hibernate.event.def.ProxyVisitor.processEntity(ProxyVisitor.java:27)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:107)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:64)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:58)
at org.hibernate.event.def.AbstractVisitor.process(AbstractVisitor.java:129)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:267)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:214)
at org.hibernate.event.def.DefaultUpdateEventListener.performSaveOrUpdate(DefaultUpdateEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:499)
at org.hibernate.impl.SessionImpl.update(SessionImpl.java:490)
at com.mpm.bo.dentalcharts.ProgressNotesDAO.updatePatientAccountObjectWhileCreatingInsuranceEstimates(ProgressNotesDAO.java:496)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 4:05 am 
Beginner
Beginner

Joined: Thu Nov 15, 2007 11:27 am
Posts: 34
I'm not a specialist, but I'll say that you try to update on session2 a persistent object linked to session1. I guess that's forbiden, because of conflict between the update on db, cache problem...

You may try to evict the object from the session1, then save it in session2. May be flushing session1 will help also.


Top
 Profile  
 
 Post subject: the fix i had done not working
PostPosted: Wed Dec 05, 2007 4:26 am 
Newbie

Joined: Thu Mar 22, 2007 12:48 am
Posts: 7
Location: Delhi
please reply ..

The fix i had done of the previous post not working consistently.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 4:51 am 
Newbie

Joined: Thu Mar 22, 2007 12:48 am
Posts: 7
Location: Delhi
thank you Yoann56


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