Symbian
Symbian OS Library

FAQ-1057 How do I debug SyncML Database Adaptors (DBAs)?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Debugging
Created: 05/18/2004 Modified: 06/16/2004
Number: FAQ-1057
Platform: Symbian OS v7.0, Symbian OS v7.0s, Symbian OS v8.0, Symbian OS v8.0a, Symbian OS v8.0b

Question:
I've created a DBA to enable me to synchronise my special PIM data with a remote server using SyncML, but the synchronisation doesn't appear to be happening. Error codes returned do not match the set specified in the header files. What should I do?

Answer:
1. Verify the SyncML database adaptor (DBA) sanity in a test harness
    The framework can return both SyncML and any other system error codes (the fact that system error codes can be returned is not documented in early versions of the Symbian Developer Library).
    By verifying the DBA in a test harness, you can ensure that the DBA is not the cause of any non-SyncML errors. The most likely cause of such an error is opening of the database.

    2. SyncML Logging
    SyncML provides minimal logging on debug builds. This is useful as it tells you the state at which the problem occured. Note that on real devices this is not an option (for most users) as debug ROMs are not available. However this can be done on the udeb emulator.

    To get the logs, create the folder c:\logs\syncml\. In addition to logs in this folder, you also get SyncML package files to and from the server in c:\. Over an HTTP transport, you may also get useful information by creating c:\logs\http\. Additionally, DevKit licensees can rebuild SyncML to specify more powerful logging options.

    3. DBA Logging
    You can create your own logging inside the DBA interface function implementations. Minimally, the state information is useful. In addition, you can get logs on real devices in order to resolve device-specific problems

    4. Emulator or device based debugging
    You can debug through the DBA on the emulator, or on the device using GDB or Metrotrk. DevKit licensees can also debug through the SyncML code on reference hardware.

    Troubleshooting
    1. My synchronisation freezes, even before the synchronisation starts.
    A likely cause is that you have not completed the TRequestStatus in OpenDbL(). The framework waits on confirmation that the database is open before attempting to call any other operation - so the TRequestStatus should be set to KErrNone following successful opening of the database.
    In most databases the open operation will be synchronous, but you still need to complete the request, because the framework can't know whether it is or not.

    2. I get a non-SyncML error code.
    There is probably a problem in your DBA code. Test the behaviour of the DBA in a test harness.