-->
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: "could not reassociate uninitialized transient collecti
PostPosted: Tue Mar 16, 2004 10:50 am 
Beginner
Beginner

Joined: Tue Sep 30, 2003 4:16 pm
Posts: 33
I am trying to debug... What does that error mean?

Thanks,

- Pito

p.s.

I am running Hibernate 2.1

Here is the stacktrace:

09:38:37 [13] InformaBackEnd SEVERE: Hibernate exception while marking [Item (76825): Korn's new video damns the music industry]read or unread
net.sf.hibernate.HibernateException: could not reassociate uninitialized transient collection
at net.sf.hibernate.impl.SessionImpl.reattachCollection(SessionImpl.java:1254)
at net.sf.hibernate.impl.OnUpdateVisitor.processCollection(OnUpdateVisitor.java:48)
at net.sf.hibernate.impl.AbstractVisitor.processValue(AbstractVisitor.java:69)
at net.sf.hibernate.impl.AbstractVisitor.processValues(AbstractVisitor.java:36)
at net.sf.hibernate.impl.AbstractVisitor.process(AbstractVisitor.java:93)
at net.sf.hibernate.impl.SessionImpl.doUpdateMutable(SessionImpl.java:1389)
at net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1403)
at net.sf.hibernate.impl.SessionImpl.update(SessionImpl.java:1289)
at com.salas.bb.channelguide.InformaBackEnd.markArticleUnread(InformaBackEnd.java:328)
at com.salas.bb.channelguide.InformaArticle.setUnread(InformaArticle.java:133)
at com.salas.bb.channelguide.InformaCGE.setAllUnread(InformaCGE.java:162)
at com.salas.bb.core.GlobalController.cmdMarkAllReadl(GlobalController.java:660)
at com.salas.bb.core.GlobalController$1.actionPerformed(GlobalController.java:178)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 16, 2004 11:23 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
When asking questions, give at least:
the Hibernate version
your mapping documents
the Java code between sessionFactory.openSession() and session.close()
the full stack trace of any exception that occurs
the name and version of the database you are using
a debug level Hibernate log excerpt is also appreciated


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 16, 2004 1:28 pm 
Beginner
Beginner

Joined: Tue Sep 30, 2003 4:16 pm
Posts: 33
All I was asking was the meaning of "could not reassociate uninitialized transient collection". Can anyone give a brief explanation or reference to the code or doc?

The code you are asking for is across several routines and will take some work to collect.


Top
 Profile  
 
 Post subject: Re: "could not reassociate uninitialized transient collecti
PostPosted: Mon Sep 27, 2010 1:34 pm 
Beginner
Beginner

Joined: Sat Sep 17, 2005 6:50 am
Posts: 23
pitosalas, it looks like the Hibernate session is closed and the parent entity you are trying to update, became a detached entity. So you have two ways out:
  • Attach an entity to the Session, as described here. Then you need to initialize lazy collections as is mentioned here. After that you can do the update.
  • Try to span the lifetime of the Session from the moment you load the entity till the moment you update it. So probably the approach "Hibernate Session per HTTP request" will not work for you, and you will need "Hibernate Session per HTTP session" (see the way it is implemented in Spring Web Flow; you may get some ides from here as well).


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.