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.