-->
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.  [ 6 posts ] 
Author Message
 Post subject: Upgrade RC2 Issue - Can NOT Refresh an object in Session
PostPosted: Wed Sep 28, 2005 1:29 pm 
Newbie

Joined: Fri May 13, 2005 11:14 am
Posts: 18
Hi all.

I upgraded to RC1 from 0.9.1.0 and now functionality (refreshing an object into a new Session) that was working isn't anymore. I didn't see anything in the release notes pertaining to this. Please let me know. Here are the steps that I do.

I retrieve an object from an ISession.
I close the ISession.
Then I open a new ISession.
I would then call ISession.Refresh(object) to attach that object to the newly opened ISession.
But, that object isn't attached to the new Session.

Thanks,
Jamie


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 1:30 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
Is that RC2 or RC1?


Top
 Profile  
 
 Post subject: Sorry - It's RC2
PostPosted: Wed Sep 28, 2005 2:33 pm 
Newbie

Joined: Fri May 13, 2005 11:14 am
Posts: 18
The issue is in RC2.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 3:24 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
This looks like a bug, but the code to reassociate an object is there in Refresh so I can't tell what the problem is. Can you please post your code and mappings?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 3:29 pm 
Senior
Senior

Joined: Sat May 14, 2005 8:40 am
Posts: 130
I might be wrong here, but I think ISession.Refresh() just refreshes the object from the database in the same session. ISession.Lock() is used to attach objects between sessions.
Perhaps ISession.Refresh() worked by accident :), but ISession.Lock() is definately the method to attach objects to other sessions.

_________________
Cuyahoga


Top
 Profile  
 
 Post subject: Lock Works!
PostPosted: Wed Sep 28, 2005 4:26 pm 
Newbie

Joined: Fri May 13, 2005 11:14 am
Posts: 18
Oh!!! OK, that's fine then.

I switched my code from
session.Refresh(obj);
to
session.Lock(obj, LockMode.None);


And that works great!

Thank you very much


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