-->
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.  [ 4 posts ] 
Author Message
 Post subject: Abusing RMI and Hibernate
PostPosted: Thu Jun 17, 2004 7:32 pm 
Newbie

Joined: Tue Oct 21, 2003 1:25 pm
Posts: 14
Location: Los Angeles, CA
I'm trying to remote the functionality of the Hibernate Session over RMI.

I've got a RemoteSession which implements the Session interface, and delegates to a remote Session via RMI.

First of all keep in mind any time you move an object over RMI, your making copies of it. Therefore you gotta get fancy with evicting and locking things as they come in and go out across the wire. This isn't the most sexy thing you've ever seen, but it can be done.

The problem lies with Lazily Loaded collections.

The PersistentCollection maintains a transient reference to the Session. Therefore the act of loading it over the wire gaurentees you'll loose your reference to the Session.

Locking it using the Session dosn't solve the problem, because a (fresh) copy of the object is locked on the Server (requiring you to evict the inital copy), but the copy on the client can't possibly benifit from that.

What I -really- want to do is associate the client side RemoteSession (implements Session) with the PersistentCollection. Is there an elegant way of doing this? Is there a way to 'load' all lazily loaded collections (besides marking them lazy="false")? Is there another solution I havn't considered?

Thanks in advance!

-Travis <tsavo@ifilm.com>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 21, 2004 3:43 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Consider using a "remote JDBC" driver, you'll keep sesion consistency

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 23, 2004 5:57 pm 
Beginner
Beginner

Joined: Fri Jan 16, 2004 3:22 pm
Posts: 26
hi

Emmanuel, could you elaborate more on what a "remote jdbc driver" means?

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 27, 2004 5:44 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Something like that

Client <-------------------------------------------------------> Server
Hibernate -> JDBC (client part)--SQL over HTTP or RMI---> JDBC server part

_________________
Emmanuel


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