[Kde-pim] Question: Akonadi::TransactionSequence

Volker Krause vkrause at kde.org
Wed Jan 23 15:52:35 GMT 2008


On Wednesday 23 January 2008 15:56:58 Kevin Krammer wrote:
> yesterday I imported a KABC resource implemented using Akonadi as its
> storage http://websvn.kde.org/trunk/playground/pim/akonadi-kres/kabc/
>
> One of the issues of the initially imported version is that
> Resource::save() has basically been implemented as a series of job creating
> + job->exec().
>
> To improve this and to also get a proper asyncSave() implementation, I
> looked through libakonadi for job chaining and found TransactionSequence.
>
> I created an internal  subclass called SaveSequence and add the
> ItemDeleteJob, ItemStoreJob and ItemAppendJob to it before either executing
> it using exec() (for the synchronous save() method) or start() (for the
> asyncSave() method).
>
> However, while testing, I got an error logging from Akonadi::Session (added
> the current job to the output):
>
> Akonadi::SessionPrivate::jobDone: Akonadi::ItemDeleteJob(0x81049f8)
> Non-current job finished. Current Akonadi::TransactionSequence(0x8131d20)
>
> My guess is that I am not using the TransactionSequence correctly or using
> it for a job it wasn't intended for.

No, that's actually a known issue in Akonadi. ItemDeleteJob uses transactions 
internally as well, but the server can't handle cascaded transactions yet, 
libakonadi/itemsync.cpp has the same problem. As a workaround, you can use 
Job instead of TransactionSequence, this requires only minimal code changes 
since Job is a KCompositeJob already. Compared to TransactionSequence this 
has the obvious drawback of not being atomic as well as being considerably 
slower.
Of course, fixing the server would be preferred instead ;-) It's basically 
adding transaction counting to DataStore and adjusting the usage of 
inTransaction() accordingly I think.

regards
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20080123/67fc8e07/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