-->
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: Remoting, Update, and Collections
PostPosted: Tue Feb 21, 2006 6:57 pm 
Newbie

Joined: Wed Feb 01, 2006 3:30 pm
Posts: 7
Hi,

I am building an application that uses NHibernate.

The web layer makes a remote call to the business layer through remoting for a business object. The business object is passed by value back to the web layer where it is modified, after which I want to send it back to the remote business layer so that I can call session.update() on the business object.

The problem I get is that NHibernate does not recognize that the items in the collection (which is marked lazy=false) are not brand new but should also be updates.

A primary-key already exists exception gets thrown.

Is there any way to correctly do updates across sessions with remoting and cascading collections?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 8:51 pm 
Newbie

Joined: Wed Feb 01, 2006 3:30 pm
Posts: 7
neverming, I found the problem. It had to do with the composite key unsaved-value property. The work around I did was to use an autogenerated id for the primary key and use a unique constraint to make sure the composite key was unique.


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.