-->
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: POJO in client-server environment with RMI.
PostPosted: Mon Sep 18, 2006 5:43 am 
Newbie

Joined: Mon Sep 18, 2006 5:21 am
Posts: 6
Hi,
I have question about Hibernate object id policy.
I have client-sevrer architecture with RMI as a communication layer.
I have persistent object A that has a List of persistent objects B. List has cascade option set to all-delete-orphan.
I create A on the client side (the ArrayList List implementation is used) and fill it with instances of objects B.
I pass (via RMI) object A to server to persist it, ids are assigned by Hibernate to all persistent objects.
Now I fill the objects on the client side with ids generated on the server side - if I don't do it, next attempt of saving the objects will create new instances in DB.
I also discovered that I have to use Hibernate implementation of List on the client side (I pass the List via RMI, remove it's contents and add the client-side objects to it). If I don't do it the cascade deleting is not working properly.
I noticed however that sometimes the ids of objects B are reaasigned. It looks that removing objects B from list and assigning them again sometimes causes reassigning persistent id for them. Is it possible? What is the policy of assignig id for persistent objects? Does removing object from a list and assigning it again cause creation of new id for that object?

Thanks for any Help.
John.

_________________
John


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.