-->
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: detach() semantics
PostPosted: Fri Dec 17, 2004 11:25 am 
Newbie

Joined: Fri Nov 05, 2004 6:54 am
Posts: 8
Location: Munich
I'm currently writing my diploma thesis partial about Hibernate. I've got the problem, that I don't know the exact detach() semantics:

- How does detach() react, if the object graph to detach is not completely loaded?

- How does detach() react, if others hold references to the same object? They think, the object is still within a session, but it's not if a thrid applies detach() !? I know, if I use threadlocal Sessions this won't be very common, but it could be an ugly side effect.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 12:08 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
you'll find many usefull info in hibernate in action

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 1:12 pm 
Newbie

Joined: Fri Nov 05, 2004 6:54 am
Posts: 8
Location: Munich
I've got that book just beside me, but I'm missing that information.
Perhaps you may provide me the page
thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 1:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
1 -> you just get detached proxys, which throw an exception upon being accessed

2 -> the session is not thread safe anyways


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 1:23 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Chapters 4, 5 and 8.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 1:58 pm 
Newbie

Joined: Fri Nov 05, 2004 6:54 am
Posts: 8
Location: Munich
But it's also possible in a single threaded environment, that multiple objects are holding a reference to the same object.

But perhaps I just don't know the magic behind detaching.
Does Hibernate copy the real object behind the proxy?
I thought Hibernate does not always put a proxy in front of an object - it prefers inspection.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 4:39 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
It would need many pages to explain it, so reread the chapters. It's quite easy to understand, but it looks like you are totally on the wrong track.


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.