Rickard Öberg schrieb:
On 8/3/11 17:12 , Falko Bräutigam wrote:
Rickard Öberg schrieb:
On 8/2/11 22:12 , Falko Bräutigam wrote:
I'm about to implement this. Seems to work well. Strong references for
timestamps and a (valid) cache for the states.
But now, after a ConcurrentEntityStateModificationException occurred
and
the user has "merged" the entity versions, I don't see a way to tell
the
ConcurrentModificationCheckConcern that this entity version is now
"merged" and hence "valid" (if it was not modified after this merge,
which I cannot detect either). Do I miss something?
What is a "merge"?
As there are now a modified version of an entity in the backend store
and modifications in the Uow of the user, the user has to decide what
values are "valid". Maybe the user is presented an UI with two editors
side by side: my version and the stored version. After this the entity
is valid "by definition" (as long as since last read from store
timestamp has not changed again.)
Ok, comparing like that I can understand. Still, what is a "merge" in
Qi4j? I don't think we can do anything like that.
Yes, this is exactly my problem. I need to support this merge scenario but don't
see how to do. Once the Uow is "invalid" (concurrent modification exception) I
don't see a way to "cure" this using the current API/SPI of Qi4j.
The usecase I described above is valid, I think. Probably any system that deals
with concurrent modifications using optimistic locks needs a) a way to detect
concurrent modifications and b) a way to "merge" concurrent modifications. Where
b) is domain specific and thus needs to be done by the user, so an exposed API
is needed to let the programmer give the user a proper UI to do it.
Hmmm... in Qi4J to support b) I could open a new UoW and transfer entities
(together with my "merged" modifications). Is this possible using
UnitOfWork.get(T) ?
-Falko
--
Falko Bräutigam
http://polymap.org
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev