-->
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.  [ 7 posts ] 
Author Message
 Post subject: Hibernate problem with collections in client/server app
PostPosted: Fri Dec 12, 2003 12:45 pm 
Newbie

Joined: Tue Sep 02, 2003 1:12 pm
Posts: 10
Hello,

Im building a client/server application using RMI and Hibernate in the server side. To save, delete and retrieve persistent objects I built a class on the server called ServerAcess with methods saveObject, deleteObject, retrieveAllObjects etc that can be accessed by clients via RMI. The objects are passed from client to server and vice-versa via Serialization.

Example:

public Set retrieveAllObjects(Class persistenteClass) would retrieve all persistent objects of the desired persistent class.

The idea is to completely separate the clients from the persistence mechanism. I mean, clients cannot use any library from Hibernate, only the server can do that.

While I was using it with objects with no one-to-many associations it was working fine. However, now I have a persistent object with a set of other persistent objects and im stucked in a problem: The Set class used by Hibernate is not the same Set class used in Java API, it is a own implementation. So,

_________________
Henrique Velloso
--------------------
System Architect
FUNDEP - UFMG - BRAZIL


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 1:26 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
No way. Hibernate use it's own implementation of collection (with respect) to the abstract Set, List and Map however) in order to know if a collection has been updated, and to allow lazy loading of collection.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 1:40 pm 
Newbie

Joined: Tue Sep 02, 2003 1:12 pm
Posts: 10
You mean I willl have to install all Hibernate libraries in the clients to have it working?? Or there is another alternative?

Thank you,

_________________
Henrique Velloso
--------------------
System Architect
FUNDEP - UFMG - BRAZIL


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 1:44 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Deep copy ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject: You need hibernate library on client?
PostPosted: Wed Jan 28, 2004 10:33 pm 
Beginner
Beginner

Joined: Thu Nov 20, 2003 8:13 pm
Posts: 31
Location: Newport Beach, CA
Isn't the Hibernate collection class simply serialized to the client? What do you need the Hibernate library on the client for?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 7:04 am 
Newbie

Joined: Tue Sep 02, 2003 1:12 pm
Posts: 10
Hibernate collections are serialized to the client, so I have to have its libraries in the clients so that they can recognize it.

_________________
Henrique Velloso
--------------------
System Architect
FUNDEP - UFMG - BRAZIL


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 20, 2004 7:45 am 
Newbie

Joined: Sat Oct 11, 2003 2:01 pm
Posts: 7
I'm having the same problem. While it's easy to make a deep copy, I think it's ugly solution and unnecessary because the collection already exists.

Is there any way to get the original collection out of the hibernate wrappers?

Thanks in advance and keep up the great work! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 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.