Forum Stats

  • 3,826,921 Users
  • 2,260,725 Discussions
  • 7,897,122 Comments

Discussions

ORA-22881 Dangling ref when registering recently deleted XML schema

6b8cb736-c1cc-4a22-b538-1632315a8f26
edited Aug 31, 2015 3:25AM in XML DB

This is my first post. If I have broken any rules or am posting in the wrong place, please forgive me and point me in the right direction.

When deleting and then re-registering a recently deleted XML schema (let's call it DOC.XSD), I get a dangling ref error:

ORA-22881: dangling REF

ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 72

ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 33

The schema is part of a graph of over a dozen inter-dependent XSDs, so I cannot easily package up all relevant files for consumption here, but I'd like help identifying relevant things that are relevant that I may have missed.


Some points that I think are relevant:

  • Oracle version 11.2.0.4.0
  • All schemas in the dependency graph were initially registered with genTypes  => false and genTables => false
  • The new registration is also done with genTypes  => false and genTables => false.
  • The delete of DOC.XSD is done with delete_option => dbms_xmlschema.DELETE_CASCADE_FORCE. It appears to succeed, and seems to invalidate exactly the eight dependent schmas that I would expect to be invalidated.
  • The re-registration of even the same, unaltered schema then fails when it has a dependency on COMMON.XSD, which itself has dependent schemas and one dependency shared with DOC.XSD
    • COMMON.XSD has some dependent schemas in common with DOC.XSD, and therefore some of its dependents (but not its dependencies) are still invalid during DOC.XSD's registration
  • This behaviour appears to be unchanged if I do a commit after the delete
  • If I modify tDOC.XSD to remove the dependency on COMMON.XSD, the registration now succeeds (but the XSD is now wrong)
  • I ran execute immediate 'ALTER SESSION SET EVENTS = ''31098 trace name context forever'''; but Unless I am looking in the wrong place, the diags created are just a dump of the XSD and don't seem obviously useful.


What type of REF could be left dangling? What is being done during the registerSchema stage that would detect or result in a dangling ref? How can I diagnose this problem further? How might I identify a repro scenario that is independent of my complex XSD dependency graph?


Thanks in advance for any advice you can offer.

Tagged:

Answers

  • odie_63
    odie_63 Member Posts: 8,492 Silver Trophy
    edited Aug 31, 2015 3:25AM

    Hi,

    What type of REF could be left dangling?

    When registering, Oracle stores XML schema data in multiple XMLType tables using Object-Relational storage.

    For example, all XML elements definitions are stored in table XDB.XDB$ELEMENT, and top-level schema information is stored in XDB.XDB$SCHEMA which references its list of elements via a collection of REFs to the XDB$ELEMENT table.

    What I think happened here is that one of these REFs (imported/included element or type) has been left dangling when you deleted the schema.

    Try to re-register with force => true, and validate all invalid schemas one by one using dbms_xmlschema.compileSchema() procedure.

This discussion has been closed.