-->
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: Persistent objects spaning mutiple sessions
PostPosted: Wed Jan 21, 2004 10:19 am 
Newbie

Joined: Mon Jan 12, 2004 3:25 pm
Posts: 9
I am not sure whether it is a setting issue, my understanding or simply hibernate non-support.

Here is the problem:

I have a persistent object Applicant. I open a new session and retrieve an applicant that I already have in the databse. I transfer the object to a presentation layer, while the session that retrieved it goes away.

After a little manipulation of the object in the presentation tier it comes back and I try to save it. I open a new Session - s, and do s.saveOrUpdate (applicant). If my Applicant object is not changed and I do flush () an update is issued, which tells me that hibernate is not keeping the instance state with the instance but rather does it in the session. Is it correct?

Is there any way to keep the state with the instance, so that unnecessary updates are not issued? Maybe there is another way to achieve the same thing?

Does anyone has a clue?

Thanks,
Alex.


Top
 Profile  
 
 Post subject: Re: Persistent objects spaning mutiple sessions
PostPosted: Wed Jan 21, 2004 10:52 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
alex.shn wrote:
which tells me that hibernate is not keeping the instance state with the instance but rather does it in the session. Is it correct?

You're correct

alex.shn wrote:
Is there any way to keep the state with the instance, so that unnecessary updates are not issued? Maybe there is another way to achieve the same thing?

session.disconnect(), session.reconnect()

there was a thread on that topic (state in object vs in session) some time ago, if I remember well.

_________________
Emmanuel


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.