[Kde-pim] Question: Akonadi::TransactionSequence

Volker Krause vkrause at kde.org
Tue Jan 29 15:39:50 GMT 2008


On Wednesday 23 January 2008 22:44:56 Kevin Krammer wrote:
> On Wednesday 23 January 2008, Kevin Krammer wrote:
> > On Wednesday 23 January 2008, Volker Krause wrote:
> > > 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.
> >
> > Ah, ok. So I tried the worst possible case right at the first attempt ;)
> >
> > I am currently mostly interested in the queueing so I'll try Akonadi::Job
> > for now.
>
> Hmm, I am still having problems.
> First I replaced TransactionSequence with just Job as the base class for my
> SaveSequence class.
> Then I tried adding a new contact (thus also avoiding the ItemDeleteJob),
> so the first sub jobs is an ItemAppendJob, followed by a number of
> ItemStoreJobs.
>
> But this produced the following:
>
> kabcclient(27122)/libakonadi Akonadi::SessionPrivate::jobDone:
> Akonadi::ItemAppendJob(0x8137c88) Non-current job finished. Current
> Akonadi::Job(0x81367c8)

I had a quick look at the code, the reason might be that you create those jobs 
without a parent object. Thus they are associated with the default session 
instead of the parent job/transaction sequence, although you called 
addSubjob() manually. This results in two instances feeling responsible to 
manage the job (the top-level session and the parent job), which obviously 
confuses at least one of them.

We probably could add an assert() in addSubjob() to check for this, or just 
make it private since it is called internally already on the parent job.

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