I am having a similar problem. In my application I have a form with a list of tasks that users can work on. When a user begins working one, the row is updated to reflect this. The application tries to refresh the list once a minute, but updates aren't being reflected in the objects returned from query.
I have tried using SetCacheable(false) and SetForceCacheRefresh(true) but I still get old copies of the objects.
I get this using both 1.0.2 and 1.2b.
Below is the snippet of code I am executing. So, what am I doing wrong?
Code:
IQuery q
= session.CreateQuery(
"select ca from CreditApplication ca inner join ca.CreditApplicationStateList currstate "
+ " where currstate.AppState = :appstate "
+ " and currstate.DateTimeStateEntered <= :now and currstate.DateTimeCompleted >= :now "
+ (merchId > 0 ? " and ca.Merchid = :merchid " : "")
);
q.SetDateTime("now", DateTime.Now);
q.SetString("appstate", (state != null && state.Length > 0 ? state : "PROCESSING_TERMINATED"));
if (merchId > 0)
q.SetInt32("merchid", merchId);
q.SetCacheRegion("CreditApplicationDAO.FindAllActiveApps")
.SetCacheable(false)
.SetForceCacheRefresh(true)
;
IList apps = q.List();