[Yanel-dev] Atomic operations in Yarep

Cedric Staub cedric.staub at wyona.com
Mon Jan 24 11:15:33 CET 2011


Hello

On Fri, Jan 14, 2011 at 06:36:53PM +0100, Balz Schreier wrote:
> do you agree that there is a potential of data inconsistency when modifying
> a Yarep Group from within your application?

Yes.

> Scenario:
> - The application itself can add and remove groups to a certain user,
> depending on what that user is doing in your application.
> - At the same time, a Yanel Administrator modifies memberships via the out
> of the box Group Mgmt page via toolbar.
> 
> Now, the application can remove a membership like this:
> 
>                    group.removeMember(user); // this also removes the group
> entry in the user XML and the user object gets saved!
> 
>                 group.save();
> 
> As you can see, there is no possibility that these two steps are done in 1
> step (in Java terms: synchronized).
> It also does not help if you write a Facade which does these two steps in a
> synchronized way because those modifications from the yanel admin page are
> still bypassing that facade.

I can see how that could go wrong.

> So my suggestion would be to extend Yarep by introducing this mechanism
> built-in, so that there is no way that files can get corrupt.
> 
> If you agree, we should work once on a patch for Yarep where such operations
> are handled atomic.

Sure, but then what about other scenarios? I think what we really need
here is a facility which allows for transactions like a relational
database has them. But implementing that will be rather difficult I
imagine. How would you go about doing this?

Cheers
Cedric


More information about the Yanel-development mailing list