Hi Vidar,

2012/7/6 Vidar Ramdal <vram...@apache.org>:
> From https://cwiki.apache.org/confluence/display/SLING/Supporting+CRUD :
> "Changes are not persisted immediately but stored transient. When all
> changes are done, a save/commit calls needs to be done trying to
> persist all changes to all resource providers."
>
> Let's say a changeset involves several resource providers, which in
> turn are called to save the changes, and the second resoure providers
> fails.
> What will happen to the changes already saved by the first resource
> provider? Should these be rolled back?
Yes, basically I think so - now I guess the next question is what
happens if rollback is not possible?

I think we can either choose one of two ways:
- persist each change immediately; this was my initial idea. But
obviously this has performance and consistency drawbacks. Consistency
could be sovled with JTA transactions.
- keep changes in a transient space and have an explicit save call

The second option seems more natural and as long as only one resource
provider is affected by the changes, everything is fine.
The problems start as soon as changes go to different resource
providers. In that case a rollback mechanism is required but can fail
as well.
I'm not sure if we can solve all the use cases, so I think we're fine
if we have this :)

Carsten

>
> --
> Vidar S. Ramdal <vidar.ram...@webstep.no>
> Webstep AS - http://www.webstep.no
> Besøksadresse: Lilleakerveien 8, 0283 Oslo
> Postadresse: Postboks 272 Lilleaker, 0216 Oslo



-- 
Carsten Ziegeler
cziege...@apache.org

Reply via email to