-->
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: Hibernate issues on Orion 2.0.2, but not JBoss 3.2.2.
PostPosted: Fri Oct 17, 2003 8:42 am 
Regular
Regular

Joined: Mon Sep 08, 2003 10:05 am
Posts: 50
Location: Dublin, Ireland
I posted this to Application Architecure by mistake..

I have a piece of code that works fine on JBoss 3.2.2, but fails on Orion 2.0.2, with the following error:

Code:
Another object was associated with this id (the object with the given id was already loaded): [com.BLAH.core.entity.NextId#3]


Now I know that this is normally because there are 2 different objects loaded, both with the same id.. but the thing is, I get the item back from a collection (via Session.find() ), I never make any copies of it..


It seems that the object address is getting changed as soon as I pass the object to a Stateful Session Bean (persistence), in the following way:

Code:
PersistenceHome persistHome = PersistenceUtil.getHome();
persistence = persistHome.create();

//assign the NextId instance to the first value in a Collection
Iterator iter  = nextIdCollection.iterator ();
nextId = (NextId) iter.next ();
log.info ("Next Id '" + nextId + "'");

persistence.update (nextId);


The first thing I do in the persistence.update () method is print the object passed in, and voila, it has a different address!!

Code:
Next Id 'com.kbcam.core.entity.NextId@aea8cf'
updating object: com.kbcam.core.entity.NextId@ccd249


As a result of the address changing, the update thinks it is a second (and distinct) instance of NextId, which just happens to have the same id as one already loaded into the session (which it is not).

Now while this looks like it is not specifically a Hibernate issue (but will affect Hibernate users on Orion), I'm hoping someone out there will know enough about EJB containers (in particular Orion) to be able to point me in the right direction??

My best guess so far is that this is related to Serialization somehow.

Any ideas??


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.