-->
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: Prob with sessions merge method
PostPosted: Fri Nov 25, 2005 2:16 am 
Newbie

Joined: Mon Sep 26, 2005 8:43 am
Posts: 16
I am in the process of upgrading Hibernate from version 2.1.6 to 3.0.5. Hibernate 3 Migration Guide says to replace saveOrUpdateCopy with merge. But by doing so many of my test cases fail with following kind of stack trace. When I replace the merge() method with saveOrUpdate(), everything works fine. Is there any problem with merge or is there a problem with the way it has been used in my application?

Code:
<testcase classname="com.abc.service.product.cases.InventoryTests" name="testMultipleInventory" time="0.321">
<error type="java.lang.UnsupportedOperationException">java.lang.UnsupportedOperationException at java.util.AbstractList.remove(AbstractList.java:171) at java.util.AbstractList$Itr.remove(AbstractList.java:436) at java.util.AbstractList.removeRange(AbstractList.java:661) at java.util.AbstractList.clear(AbstractList.java:257) at org.hibernate.collection.PersistentIdentifierBag.clear(PersistentIdentifierBag.java:90) at org.hibernate.type.CollectionType.replaceElements(CollectionType.java:393) at org.hibernate.type.CollectionType.replace(CollectionType.java:426) at org.hibernate.type.TypeFactory.replace(TypeFactory.java:385) at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:239) at org.hibernate.event.def.DefaultMergeEventListener.entityIsPersistent(DefaultMergeEventListener.java:125) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:106) at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:54) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:535) at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:539) at com.abc.service.product.ABCProductTestCase.prepareConfigurableEntities(ABCProductTestCase.java:191) at com.abc.ABCAbstractTestCase.onSetUpInTransaction(ABCAbstractTestCase.java:126) at org.springframework.test.AbstractTransactionalSpringContextTests.onSetUp(AbstractTransactionalSpringContextTests.java:93) at org.springframework.test.AbstractDependencyInjectionSpringContextTests.setUp(AbstractDependencyInjectionSpringContextTests.java:123)</error>
</testcase>

_________________
--Beejal


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.