I would not even try to implement something like the Java Transactions API.<div>Distributed transactions are one of the most complex topics in software engineering, maybe it is the most complex at all...</div><div><br></div>
<div>I would rather think of offering "controlled" methods in addition to the current API where the client doing the modification can choose between the current API and the new ones.</div><div>The new ones could checkout the node, do the modification and checkin again (as yarep offers today).</div>
<div><br></div><div>I understand that this is not designed and implemented over night, but it would be a great addition to Yanel / Yarep.</div><div><br></div><div>When thinking of clustered environments, the solutions can look different:</div>
<div>- one single service that others "instances" can call remotely for doing the changes?</div><div>- locking mechanism as described above? --> With the locking approach you quickly run into the problem of needing a distributed filesystem (as of the latest Lucene book, NFS, Samba/CIFS1.0 and Samba/CIFS2.0 have all severe issues and are not good candidates to be used in write mode)</div>
<div>- other approaches?</div><div><br></div><div>Cheers</div><div>Balz<br><br><div class="gmail_quote">On Tue, Jan 25, 2011 at 10:32 AM, Michael Wechner <span dir="ltr"><<a href="mailto:michael.wechner@wyona.com">michael.wechner@wyona.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On 1/24/11 10:15 AM, Cedric Staub wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello<div class="im"><br>
<br>
On Fri, Jan 14, 2011 at 06:36:53PM +0100, Balz Schreier wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
do you agree that there is a potential of data inconsistency when modifying<br>
a Yarep Group from within your application?<br>
</blockquote></div>
Yes.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Scenario:<br>
- The application itself can add and remove groups to a certain user,<br>
depending on what that user is doing in your application.<br>
- At the same time, a Yanel Administrator modifies memberships via the out<br>
of the box Group Mgmt page via toolbar.<br>
<br>
Now, the application can remove a membership like this:<br>
<br>
                    group.removeMember(user); // this also removes the group<br>
entry in the user XML and the user object gets saved!<br>
<br>
                 group.save();<br>
<br>
As you can see, there is no possibility that these two steps are done in 1<br>
step (in Java terms: synchronized).<br>
It also does not help if you write a Facade which does these two steps in a<br>
synchronized way because those modifications from the yanel admin page are<br>
still bypassing that facade.<br>
</blockquote></div>
I can see how that could go wrong.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So my suggestion would be to extend Yarep by introducing this mechanism<br>
built-in, so that there is no way that files can get corrupt.<br>
<br>
If you agree, we should work once on a patch for Yarep where such operations<br>
are handled atomic.<br>
</blockquote></div>
Sure, but then what about other scenarios? I think what we really need<br>
here is a facility which allows for transactions like a relational<br>
database has them. But implementing that will be rather difficult I<br>
imagine. How would you go about doing this?<br>
</blockquote>
<br>
maybe using<br>
<br>
<a href="http://en.wikipedia.org/wiki/Java_Transaction_API" target="_blank">http://en.wikipedia.org/wiki/Java_Transaction_API</a><br>
<br>
Just my two cents<br>
<br>
Michael<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Cheers<br>
Cedric<br>
</blockquote>
<br>
-- <br>
Yanel-development mailing list <a href="mailto:Yanel-development@wyona.com" target="_blank">Yanel-development@wyona.com</a><br>
<a href="http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development" target="_blank">http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development</a><br>
</blockquote></div><br></div>