Re: Concurrency?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Oct 31 2003 - 11:40:22 EST


Hi Axel,

in Cayenne 1.0.* DataContexts do not communicate with each other, so
you may see some stale data cached by a DataContext. Your options are
mostly to refresh certain objects manually, either by rerunning a
certain query or using "DataContext.invalidateObject()". Or even
discarding a session DataContext, and replacing it with a new one (but
this is extreme).

In 1.1 (that is still pre-Alpha and not ready for production use) we
have a shared cache with event notifications between the contexts (both
local and cross-VM). Most of this code is already there (you can take a
pick at one of the latest nightly builds). Now I am at the point of
testing concurrency issues with this massively parallel system. Next
step would be to add Modeler configuration support for that, and then
we may release an Alpha.

Andrus

On Oct 31, 2003, at 10:26 AM, Axel HONFI wrote:
> Hello!
>
> I'm using Cayenne from within a webapp - is there any built-in
> concurrency-mechanism?
> When data from a data-object is loaded into a HTML-page with a form,
> the
> data can be updated in the meanwhile by another user. I tried saving
> the
> data-object in the session of the user, but still another user could
> "interfere". Even with the same user and two windows open (same
> dataContext) I found no way to track a commited change of the object
> between reading the object and commiting the changed properties.
>
> Is there an easy way to avoid this kind of concurrency?
>
> Thanks,
>
> Axel



This archive was generated by hypermail 2.0.0 : Fri Oct 31 2003 - 11:40:27 EST