-->
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: Problem with session.update()
PostPosted: Sun Jul 03, 2005 8:24 am 
Newbie

Joined: Mon Jun 27, 2005 3:01 pm
Posts: 3
hello all,
I'm habig a problem with the session.update() operation.
I'm using hibernate 3.0.4 and Oracle 9x.
I have a regular flow of getting an object using a session.createQuery(), updating his values (including some many-to-many relations) and then transaction.commit(). I dicovered that this set of operation doesn't changes anything in the DB so i'v tried to add a session.update() before the transaction.commit() for existing objects and a session.save() for a new object. the problem is i get the following exception:

Code:
org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions
   at org.hibernate.collection.AbstractPersistentCollection.setCurrentSession(AbstractPersistentCollection.java:231)
   at org.hibernate.event.def.OnUpdateVisitor.processCollection(OnUpdateVisitor.java:41)
   at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:104)
   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 fdms.fdmsServlet.doUpdateUser(fdmsServlet.java:1008)
   at fdms.fdmsServlet.doGet(fdmsServlet.java:135)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Unknown Source)


does anyone has an idea? every help will be appriciated.....

thanx,
Israel.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 03, 2005 8:50 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Why didn't you follow the steps outlined here:

http://www.hibernate.org/ForumMailingli ... AskForHelp


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.