Hi Raphael,
so_sql does not have the problem, as it works unmodified/un-extended
only with one table. It’s the derived classes, which eg. use multiple
so_sql instances to deal with multiple tables, who need to start the
transation.
The best way to deal with the last update win situation is a query like:
UPDATE table SET etag=etag+1, WHERE id=… AND etag=123
This statement fails (affected rows = 0), if anyone else already updated
the row. InfoLog and Calendar then go back to the user and ask him to
manually merge his changes in the updated entry. GroupDAV/CalDAV simply
fail with “precondition fail” and it’s up to the client to deal with it.
Ralf
Raphael Alla schrieb:
Hi Ralf,
thanks for this answer. I did not realise that some apps already had a
way to handle the ‘last wins’ situation, I’ll check that.
The other issue, multiple sql updates, seem to occur a lot in my code so
I was more aware of it and took the necessary steps to make sure I used
transactions where needed. At this stage, I believe the issue should not
be addressed on a case by case basis but by allowing egroupware to
better define its data model by:
- allowing to define in which context the multiple tables or updates
take place (typically when you have two objects connected by a 1 to 1, 1
to n, or n to n relationship)
- improve/extend the existing so_sql class to handle these situations
as they should
I can propose some code that does the above; and I believe these issues
have been thought about in the design of Tine2. Yet at the same time I
wonder if either using existing libraries or designs from other open
source project may not be a better approach (why reinvent the wheel, but
will the wheel of other projects fit egroupware?)
A generic approach for the issue of ‘the last wins’ should be looked at
as well.
2008/2/27, Ralf Becker <RalfBecker@outdoor-training.de
mailto:RalfBecker@outdoor-training.de>:
Hi Raphael,
eGW already deals with the last wins situation in the followig apps:
- infolog (since 1.2)
- calendar (in trunk)
- groupdav (1.4)
Though only calendar uses a real counter, the other two use the last
modification date at the moment.
Data integrety or transactions is only a problem, if you have multiple
tables (or updates), as a single sql statement always runs as
transaction.
That means it's currently only critical with the calendar, where we
should add transactions around multiple table/statement updates.
I want to add a real update counter to addressbook and infolog too, as I
need them as etags for GroupDAV and CalDAV.
Ralf
Raphael Alla schrieb:
> In my opinion, 'the last wins' can be an issue, but its not so bad as
> long as you ensure that the integrity of the data remains. The real
> issue comes when there is a serie of database updates, that are
> happening simultaneously, and a race condition may lead to the data
> losing its integrity.
>
> In Blueerp (a set of modules for egw), this is handled by using sql
> transactions.
>
> However, what is not handled is the 'the last wins' issue, because in
> reality it almost never happens, and that with transactions the data
> always stays coherent.
>
<mailto:globalclown@web.de <mailto:globalclown@web.de>>>:
>
>
> hi devs,
> until now i was worried about small lacks of quality in
egw1.x, but
> now i
> read in an interview:
>
> The most problems (with egw) occur if there are simultaneous
> accesses to the
> datasets.
> In egw "the last wins".
>
> until now, i thought, concurrent update is handled by sql - so why
> does not
> work in egw?
> until now, i had no courage to make installation for huge
amount of
> users
> with egw,
> so i can not check wether concurrent update works - or last wins -
> as stated
> above.
> i will test it soon next weeks - that might be a nuclear bomb for
> all user
> data.
>
> this is a question concerning life or death for users data and
infos,
> so please all devs give true and reliable infos on this
problem for egw.
> wolf
>
> ps: such possible lack of integrity might cause big loss of
confidence.
> --
> View this message in context:
>
http://www.nabble.com/concurrent-updates---in-egw-the-last-wins-----tp15567236s3741p15567236.html
> Sent from the egroupware-developers mailing list archive at
> Nabble.com <http://Nabble.com> <http://Nabble.com>.
>
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> eGroupWare-developers mailing list
> eGroupWare-developers@lists.sourceforge.net
<mailto:eGroupWare-developers@lists.sourceforge.net>
> <mailto:eGroupWare-developers@lists.sourceforge.net
<mailto:eGroupWare-developers@lists.sourceforge.net>>
> https://lists.sourceforge.net/lists/listinfo/egroupware-developers
>
>
>
>
> --
> Raphael Alla
> Mitija Australia
> +61 4 15 678 576
> +687 78 86 86
> http://www.mitija.com
>
>
>
------------------------------------------------------------------------
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> eGroupWare-developers mailing list
> eGroupWare-developers@lists.sourceforge.net
<mailto:eGroupWare-developers@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/egroupware-developers
--
Ralf Becker
eGroupWare Training & Support ==> http://www.egroupware-support.de
Outdoor Unlimited Training GmbH [www.outdoor-training.de
<http://www.outdoor-training.de>]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 (0)631 31657-0
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
<mailto:eGroupWare-developers@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
–
Raphael Alla
Mitija Australia
+61 4 15 678 576
+687 78 86 86
http://www.mitija.com
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
–
Ralf Becker
eGroupWare Training & Support ==> http://www.egroupware-support.de
Outdoor Unlimited Training GmbH [www.outdoor-training.de]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 (0)631 31657-0
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers