-->
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: NonUniqueObjectException - MDB loading, Session bean saving
PostPosted: Mon Oct 11, 2004 9:46 am 
Senior
Senior

Joined: Tue Aug 03, 2004 2:11 pm
Posts: 142
Location: Somerset
Hibernate version:2.16

We have the following structure:

A message driven bean receives a JMS message with an ID number on it.

The MDB uses that ID number to load up an instance using hibernate, then changes a few values on the instance.

The MDB then calls a method on a session bean to (amongst other things) save the instance, passing the above instance as a parameter.

The save fails due to a non-unique object exception.

Quick question - am I getting this because due to the fact the EJB call has to serialize and unserialize the objects, i.e. its passing in a copy of the instance not a copy of the reference to the instance as in a usual method call ?

_________________
On the information super B road


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 12, 2004 3:55 am 
Senior
Senior

Joined: Tue Aug 03, 2004 2:11 pm
Posts: 142
Location: Somerset
For the record this was the problem, and the solution is to call the session bean via the local reference not the remote one.

Fixing the design would hav ebeen a better one, but we are in a transitional phase between EJB/JDBC and hibernate, so its not currently practical or expedient.

_________________
On the information super B road


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.