[Kde-pim] Akonadi Synchronous Job Error

Jason 'vanRijn' Kasper vr at movingparts.net
Fri Feb 20 16:04:20 GMT 2009


On Fri, Feb 20, 2009 at 7:23 AM, Volker Krause <vkrause at kde.org> wrote:

> On Friday 20 February 2009 13:02:57 Douglas Harms wrote:
> > I'm working on kpilot and have encountered a behavior problem in
> > akonadi.  For various reasons there are times when we attempt to delete
> > an akonadi item (calendar or todo) that doesn't exist.  job->exec()
> > returns false (as it should).  When we process the next record (e.g.,
> > delete a record that is in akonadi) job->exec() returns true (which it
> > should) but it doesn't actually delete the item.  As you might imagine,
> > this messes us up.
> >
> > We can easily solve this by not trying to delete an akonadi item when we
> > know it's not there; however, we wanted to bring this up for discussion
> > on this list to see if perhaps there is a larger bug in akonadi that
> > should be addressed.
>
> Are you deleting within a transaction maybe? If there is an error within a
> transaction, no change made within it will persist, like in database
> systems.
> If that should happen for usually harmless errors like deleting a
> non-existing
> object is a different question though


Hey Volker, all, and thanks, Doug, for sending this e-mail!

I'm not honestly sure if what we're doing is within a transaction.I don't
see anywhere that we're explicitly doing a
beginTransaction()/endTransaction() or something simliar. We have commit
methods in kpilot for each type of operation (create, update, delete) to
push the temp changes we made during synchronization into Akonadi, and the
code for each looks like this:

    AkonadiRecord* aRec = static_cast<AkonadiRecord*>( rec );
    Akonadi::ItemModifyJob* job = new Akonadi::ItemModifyJob( aRec->item()
);

    if ( !job->exec() )
    {
        // Hmm an error occurred
        DEBUGKPILOT << "Update failed: " << job->errorString();
        return false;
    }
    else
    {
        // Update the item of the record.
        aRec->setItem( job->item() );
        return true;
    }

That's pretty much all we're doing. So... 1) are we missing something
before/after the whole process?, 2) are we missing something before/after
each job->exec()?, 3) are we even doing this correctly?

TIA!


-- 
-[ Jason 'vanRijn' Kasper    //  http://movingparts.net ]-
-[ KDE PIM Developer         //  http://www.kde.org  ]-
-[ bash fun -> :(){ :|:&};:  //  Numbers 6:22-26 ]-
_______________________________________________
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