Error processing xml queue while saving

Whenever I save a particular item (or category) in the user interface or try to use it in a job, I get XML parser errors; other data objects are fine. Why am I getting this error and how can I correct it?

Symptoms

The application creates an XML copy of all the items and categories before committing the save operation in the database. If an item (or category) contains an unreadable character, then trying to save that item will result in an XML parser error as shown below:
Caused by: Error processing xml queue. m_xmlPendingQueue contained at time of failure: []
          ...
com.ibm.ccd.content.common.EntryXmlProcessor.sendPendingXmlToDb(EntryXmlProcessor.java:311)
at com.ibm.ccd.common.context.common.DBContext.ensurePendingXMLWrittenToDB(DBContext.java:592)
          ...
Caused by: CWPCM0577E:failed to update xml: '<entry>
          ...
at com.ibm.ccd.common.util.db2.DB2Utils.mergeXML(DB2Utils.java:197)
at com.ibm.ccd.content.common.EntryXmlProcessor.sendPendingXmlToDb(EntryXmlProcessor.java:294)
... 25 more
Caused by: com.ibm.db2.jcc.b.yn: DB2 SQL Error: SQLCODE=-16111, SQLSTATE=2200M, SQLERRMC=2, DRIVER=3.53.95
at com.ibm.db2.jcc.b.bd.a(bd.java:668)
...

Causes

The application places few restrictions on what type of data can be used with the software. But while saving special characters like &, $, Ð and so on, to the database, it is essential that these characters are first converted into database compatible format, for example and can need to be converted to &. If such a conversion does not take place, then the invalid format can result in an unreadable character causing data corruption.

Resolving the problem

Follow these steps to correct the data corruption for an item:
  1. Open the item in the single edit screen.
  2. Browse the item attributes for special characters.
  3. Remove the special character and try to save the item. If the save operation completes, then there is no further corruption and you can proceed to step 6.
  4. If you can't save the item, then repeat step 2 and 3 until all the special characters have been accounted for.
  5. If you remove all special characters and still can't save the item, then delete it and create a new one with identical information.
  6. If you were able to successfully save the item, then add all the special characters back to the item attributes and save the item for one last time. Follow similar steps for a category.
    Note: The application can support most special characters and a correctly saved special character will not cause this error. The root cause of the error is that the character was not saved properly in the database leading to an unreadable database entry. This might be due to a number of reasons including an exception while trying to perform the save operation, the database not being stable and so on.