DB2 Version 9.7 for Linux, UNIX, and Windows

Troubleshooting considerations for annotated XML schema decomposition

If you find that decomposition is not yielding expected results, several issues should be considered.

General considerations

XML schema issues

Specific errors

Adjusting database configuration parameters can resolve the following errors:
  • SQL0954C received when the annotated XML schema contains a large number of rowSets: increase the application heap size using the applheapsz configuration parameter
  • SQL0954C received when the annotated XML schema contains complex or many expressions in each rowSet: increase the application heap size using the applheapsz configuration parameter
  • SQL0964C received when decomposition results in a large number of rows: increase the number of primary or secondary log files available using the logprimary and logsecond configuration parameters. You can also increase the size of the primary and secondary log files with the logfilsiz configuration parameter.

Locking and concurrency

If you are experiencing lock escalation or deadlock when decomposing documents, adjust concurrency control through your application. If an application makes multiple concurrent invocations of any of the xdbDecompXML stored procedures, where many of the same tables are involved in the multiple decomposition operations, then the application needs to manage the concurrent access to these tables to prevent lock escalation and deadlock.

One way to adjust concurrency control is to explicitly lock all tables involved in the decomposition before invoking the xdbDecompXML stored procedure. Then execute the COMMIT or ROLLBACK statements as appropriate after the stored procedure has returned. Because the decomposition of large documents can result in a large number of rows being inserted, and because each row is locked by default during an insert operation, an application that is inserting many rows can hold many row locks, leading to lock escalation. By obtaining table locks instead, you can avoid the overhead of obtaining row locks and of lock escalation.

If the reduced concurrency associated with obtaining table locks is not appropriate for your application, you can increase either or both of the maxlocks and locklist database configuration parameters, which decreases the likelihood of lock escalation.

Set the locktimeout database configuration parameter to prevent an application from waiting indefinitely to obtain a lock.

Mapping verification in catalog view

If you are still experiencing problems with decomposition after verifying the conditions above, check that the MAPPINGDESCRIPTION column of the SYSCAT.XDBMAPSHREDTREES catalog view matches the mappings you intended. The MAPPINGDESCRIPTION column contains details on how each item in a rowSet was mapped, including:
  • target column name
  • target column type
  • item's XML schema type
  • values specified for db2-xdb:contentHandling, db2-xdb:normalization, db2-xdb:truncate, db2-xdb:expression, and db2-xdb:condition
Note that the columns of SYSCAT.XDBMAPSHREDTREES other than MAPPINGDESCRIPTION are intended for DB2® customer support.