... 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-03-01

BEA ALDSP WTF

I was struggling with submitting updated data graphs through BEA.  My data source looked something like this:

declare function tns:getWrapper() as element(ns0:TestWrapper) {
    let $TEST_TABLE := ns1:TEST_TABLE()[ID=1]
    return
      
        {fn:data($TEST_TABLE/ID)}
        {fn:data($TEST_TABLE/NAME)}
      
};

where ns1:TEST_TABLE was a physical data source.  However, whenever I tried to submit changes to this function, I would get the dreaded "no lineage" exception.  I tried various other forms for the data source, such as:

declare function tns:getWrapperForUpdate() as element(ns0:TestWrapper)* {
    for $TEST_TABLE in ns1:TEST_TABLE()
    return
      
        {fn:data($TEST_TABLE/ID)}
        {fn:data($TEST_TABLE/NAME)}
      
};

Depending upon how aggressive I got with the various wrapping elements, the submits may or may not work.  Then...

I discovered that the data service test tool in BEA Workshop supported submits.  So I tried using it to test various combinations.  One thing I noticed right away was that when I pressed the 'edit' button, the data would be retrieved in a completely different form with various "holder" elements supplied automatically.  For example, the first data service shown above would have all of its data returned in a wrapping TestWrapperDocument element.  The second data service had ArrayOfTestWrapperDocument and TestWrapperArray elements introduced throughout the tree.  Now comes the strangest part...

After messing around with various submissions through the test tool, suddenly submits that formerly didn't work started working.  Even my external Java client started working.  Apparently, the mere act of testing submissions through the test tool is enough to either change internal configuration information or perhaps even generate more classes that makes things work.  I have been unable to determine the exact sequence of events to make this magic happen.  More investigation is needed, and it seems important to build the application and/or the EAR after getting a successful submission.  Stay tuned.

Blog Archive