cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <mgen...@masslight.net>
Subject Re: lazy loading (slightly OT but still pretty important)
Date Fri, 30 Mar 2012 16:51:19 GMT
Hi Joe,

It mainly sounds like you care about optimistic locking.  Cayenne can
use whichever columns you select to test for external changes upon an
UPDATE.  As for faulting data into memory, Cayenne will get the
freshest data the DB has at that point, excluding any pending
transactional changes.  (Most databases will not make pending
updates/inserts/deletes in another transaction visible to your
transaction.)

mrg


On Fri, Mar 30, 2012 at 11:16 AM, Joe Baldwin <jfbaldwin@earthlink.net> wrote:
> OK, I am getting confused as to the subject that we are arguing.  My interest is specifically
with the thesis and conclusion:
>
>>>> Cayenne doesn't care about staleness. ... If data isn't available yet, just
load it - and accept the risk that the application may now be working with partly stale, partly
current data.
>
>
> My comment (with warning that I have not made rigorous tests), is that if Cayenne is
recognizing data that has been externally changed (i.e. not via Cayenne front door). If it
can do this, then it does seem to have supporting behavior for addressing "staleness". What
the details of that behavior are, I do not know.  It does seem that the behavior is present
though.
>
> Am I missing something?
> Joe
>
>
>
>
>
> On Mar 30, 2012, at 9:53 AM, Durchholz, Joachim wrote:
>
>>>> Cayenne doesn't care about staleness. It's the application's
>>>> task to ensure that Pojo networks are updated to the current
>>>> DB state at the beginning of an application-side transaction.
>>>> If data isn't available yet, just load it - and accept the
>>>> risk that the application may now be working with partly
>>>> stale, partly current data.
>>>
>>> Are you sure that this is correct?
>>
>> I'm not, I'm just inferring that from the fact that
>> a) Cayenne is recreating connections as needed, so it cannot rely on transactional
repeatable-read properties and
>> b) assuming that rechecking all cached records for being up-to-date whenever anything
else is loaded or stored.
>>
>>> And in the critical data, Cayenne is able to present the
>>> DBClient modified data immediately.
>>
>> This may be a side effect of having a webapp.
>> It might be reloading all data on each request (that's what webapps often do). Or
it might be refreshing all relevant data on each request.
>>
>>> For the most part, I have seen that the *default* Cayenne
>>> behavior handles the "stale" issue pretty well.  (This is,
>>> if changing data directly in the database, and then having
>>> Cayenne immediately display it via a webpage is an
>>> appropriate black-box test)
>>
>> If that works without explicit programming, that would be awesome!
>> But how would Cayenne achieve that and still have reasonable performance?
>

Mime
View raw message