... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2006-02-21

BEA SDO

BEA's SDO implementation does not appear to stand alone.  Under certain circumstances where an SDO graph is modified, the change log contains XPath expressions of sufficient complexity that the BEA SDO stack elects to invoke their full XQuery implementation.  In particular, a data graph was modified and converted to XML.  Its change summary looked like this:

<changeSummary>
  <Activity com:ref="/Activities/Activity[10]">
    <Required>1</Required>
  </Activity>
  <Activity com:ref="/Activities/Activity[11]">
    <Required>1</Required>
  </Activity>
...

When trying to rematerialize the graph using DataGraphImpl.parse(), an exception was thrown:

java.lang.UnsupportedOperationException: This query is too complex to be processed.
	at com.bea.xbean.store.XqrlDelegate.invoke(XqrlDelegate.java:70)
	at com.bea.xbean.store.XqrlDelegate.compilePath(XqrlDelegate.java:39)
	at com.bea.xbean.store.Path$XqrlPathImpl.create(Path.java:265)
	at com.bea.xbean.store.Path.getCompiledPath(Path.java:169)
	at com.bea.xbean.store.Path.getPath(Path.java:81)
	at com.bea.xbean.store.Path.getPath(Path.java:58)
	at com.bea.xbean.store.Path.select(Path.java:43)
	at com.bea.xbean.store.Cursor.selectPath(Cursor.java:2898)
	at com.bea.xbean.values.XmlObjectBase.selectPath(XmlObjectBase.java:395)
	at com.bea.xbean.values.XmlObjectBase.selectPath(XmlObjectBase.java:379)
	at com.bea.sdo.impl.DataObjectHandler.selectSdoPath(DataObjectHandler.java:1323)
	at com.bea.sdo.impl.DataObjectHandler.get(DataObjectHandler.java:212)
	at com.mm.platform.xbean.impl.ActivitiesDocumentImpl.get(Unknown Source)
	at com.bea.sdo.impl.DataGraphImpl.parseChildren(DataGraphImpl.java:520)
	at com.bea.sdo.impl.DataGraphImpl.parseDataGraphDocument(DataGraphImpl.java:451)
	at com.bea.sdo.impl.DataGraphImpl.(DataGraphImpl.java:88)
	at com.bea.sdo.impl.DataGraphImpl.(DataGraphImpl.java:96)

At first I tried simply adding BEA's xqrl.jar, which contains their XQuery engine.  However, the behaviour did not change.  Further experimentation revealed that the JARs wlxbean.jar was also necessary.  However, this combination only pushed the problem deeper:

java.lang.RuntimeException: weblogic/apache/xerces/impl/xs/SchemaSymbols
	at com.bea.xbean.store.XqrlDelegate.throwRuntimeException(XqrlDelegate.java:59)
	at com.bea.xbean.store.XqrlDelegate.invoke(XqrlDelegate.java:81)
	at com.bea.xbean.store.XqrlDelegate.compilePath(XqrlDelegate.java:39)
	at com.bea.xbean.store.Path$XqrlPathImpl.create(Path.java:265)
	at com.bea.xbean.store.Path.getCompiledPath(Path.java:169)
	at com.bea.xbean.store.Path.getPath(Path.java:81)
	at com.bea.xbean.store.Path.getPath(Path.java:58)
	at com.bea.xbean.store.Path.select(Path.java:43)
	at com.bea.xbean.store.Cursor.selectPath(Cursor.java:2898)
	at com.bea.xbean.values.XmlObjectBase.selectPath(XmlObjectBase.java:395)
	at com.bea.xbean.values.XmlObjectBase.selectPath(XmlObjectBase.java:379)
	at com.bea.sdo.impl.DataObjectHandler.selectSdoPath(DataObjectHandler.java:1323)
	at com.bea.sdo.impl.DataObjectHandler.get(DataObjectHandler.java:212)
	at com.mm.platform.xbean.impl.ActivitiesDocumentImpl.get(Unknown Source)
	at com.bea.sdo.impl.DataGraphImpl.parseChildren(DataGraphImpl.java:520)
	at com.bea.sdo.impl.DataGraphImpl.parseDataGraphDocument(DataGraphImpl.java:451)
	at com.bea.sdo.impl.DataGraphImpl.(DataGraphImpl.java:88)
	at com.bea.sdo.impl.DataGraphImpl.(DataGraphImpl.java:96)

You can see from the stack trace that BEA's own version of Xerces is required.  This, and the classes that support it, are available in weblogic.jar -- a 50 megabyte wonder.  It would appear that the whole WebLogic infrastructure needs to be pulled into the application just to rematerialize an SDO data graph object.  Thus, BEA's SDO does not appear to be "standalone".  Looking over the code for com.bea.xbean.store.Path, I can see that it attempts to use the built-in XBean XPath engine, falling back to Jaxen and XQRL if necessary.  My casual inspect was not enough to determine the circumstances under which each occurred.

Blog Archive