Problem

I am setting an OK Completion in an asynchronous call, but the action thread reports an error. What is going on?

Solution

You are probably using an old and obsolete way of initializing the completion.

In very old versions of ACS (I think until ACS 4.0) is was correct and sufficient to initialize the ACS completion received as an out parameter from the asynchronous action thread in this way:


    completion.timeStamp=getTimeStamp();
    completion.type=ACSErr::ACSErrTypeOK;
    completion.code=ACSErrTypeOK::ACSErrOK;

Actually, before Completion code generation this was the only way of doing it and therefore there is probably still code around doing in this way.

But this is not initializing all members of the completion object.

In particular it is not initializing the error trace.

The correct, and actually simpler, way to initialize a completion is using the proper generated methods:


  completion = ACSErrTypeOK::ACSErrOKCompletion();

This applies not only to the implementation of asynchronous calls (including callbacks and monitors) but also to any place in your code where Completion objects are initialized.