Andrus Adamchik wrote:
> Stateful clustered applications would normally serialize session data
> and then restore it on the node that handles current request. With Level
> 1 cache, DataContext is serialized with all its cache, so it will be
> propagated across the cluster, providing the same user experience as if
> the app was running on a single server. So ideally there is no need to
> change anything.
Oh. I see. Very nice.
Furthermore, I have re-read your posts and realized that I have probably
been making some false assumptions about Cayenne's 'caching'.
You said:
> Refreshing objects or lists on every "getXYZProperty" method call
> would be wasteful. It is up to the developer to refresh objects when
> needed. E.g. by executing a select query at the right moment (all
> returned objects will be refreshed) or by invalidating individual
> object via DataContext.invalidateObject(...). So developer would have
> to balance between probability of stale data and app performance.
Does this mean that every time I do a DataContext.performQuery(),
Cayenne fetches the data from the database? I was thinking that a
second performQuery() on a given DataContext would grab data stored in
"the cache" by the first performQuery() - but I just watched my
Postgresql log while I did some performQueries ... and I see that this
is not the case. The data is being fetched from Postgresql.
My apologies. At least this discussion is archived for the next schmuck
who comes along wondering how Cayenne caching works.
James
This archive was generated by hypermail 2.0.0 : Mon Jan 12 2004 - 15:54:50 EST