-->
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: org.hibernate.HibernateException: More than one row with the
PostPosted: Wed Mar 14, 2007 3:53 pm 
Newbie

Joined: Wed Mar 14, 2007 3:35 pm
Posts: 3
I am getting the following error when I am trying to update some of my records.

org.hibernate.HibernateException: More than one row with the given identifier was found: 3333, for class: com.dao.hibernate.TaskItem
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:135)
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:81)
org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2730)
org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:161)
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:889)
org.hibernate.impl.SessionImpl.load(SessionImpl.java:808)
org.hibernate.impl.SessionImpl.load(SessionImpl.java:801)
com.accuserverx.accucharge.dao.hibernate.UpdateWorkListDAO.update(Unknown Source)
com.accuserverx.accucharge.web.UpdateWorkListAction.execute(Unknown Source)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

I am doing the update like this


Contact myContact = session.load(Contact.class, new Integer(6));
myContact.setFirstName("new name");
session.update(myContact);
session.flush();
session.clear();


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 14, 2007 4:04 pm 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
What's the link between taskitem and contact ?

The meaning of the exception is that hibernate is loading an object with an identifier but find multiple objects instead of one : it seems that you identifier is not unique

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


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.