-->
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.  [ 1 post ] 
Author Message
 Post subject: autorefresh entities
PostPosted: Thu Jul 17, 2008 7:56 am 
Newbie

Joined: Thu Jul 17, 2008 7:32 am
Posts: 1
Hi.

I need to read data from the database, which is modified by the concurrent process. Is there any way to autorefresh my entities? (instead of calling session.refresh()).

Example:
Code:
....
ISession session = factory.OpenSession();
ICriteria c = session.CreateCriteria(typeof(MyEntity));
foreach (MyEntity me in c.List())
{
string name = me.Name;
}

DoSomething();
// meanwhile, some other process change name values in database

ICriteria c = session.CreateCriteria(typeof(MyEntity));
foreach (MyEntity me in c.List())
{
string name = me.Name;
// here I need to have current name of entity (without calling session.refresh()).
}


I tried to set cache mode of the session to ignore but with the same results :(

Thank you for any help.

P.S. Sorry for my english, it's not my native language.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.