[Kde-pim] Two Akonadi ItemModifyJobs clashing

Kevin Krammer kevin.krammer at gmx.at
Fri Sep 10 08:11:28 BST 2010


On Friday, 2010-09-10, David Jarvie wrote:
> When two instances of ItemModifyJob are created in quick succession for the
> same Akonadi Item, the conflict resolution dialog is displayed. This
> happens even if creation of the second ItemModifyJob is delayed until the
> result slot from the first job is called. How is it possible to ensure
> that the two jobs don't clash?

Item have a revision property which is used as a primary indicator for 
conflict, i.e. if the item of the job has lower revision than the item in 
Akonadi's database.

If one creates two jobs based on the same local item instance, both jobs 
reference the same revision. So the second will always have a revision too low 
for Akonadi to accept.

In the case where the second job is created in the result slot of the first 
job, make sure to use the item returned by the first job, as its revision 
property has been updated accordingly.

It is possible to disable the revision check for ItemModifyJob, but of course 
this means it will overwrite any change that might have happened elsewhere, so 
use with care.

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100910/19e8878b/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list