Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Development/DBWS/ParseDDLforMetadata/Overview"

 
(5 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
   .source-text {padding:1em;border:1px dashed black; background-color: white;}
 
   .source-text {padding:1em;border:1px dashed black; background-color: white;}
 
</css>
 
</css>
<span id="Overview">
 
 
<onlyinclude>
 
<onlyinclude>
 
The primary job of the <tt>DBWSBuilder</tt> utility is to extract metadata from the database about some artifact (i.e. a Table or a StoredProcedure) that is to be used as the basis of a Web Service. The <tt>DBWSBuilder</tt> translates the retrieved information (field names, arguments, scalar or composite datatypes, etc.) into DBWS runtime artifacts (EclipseLink Project XML files, WSDL and XML schema, etc.) Thus it is crucial that <tt>DBWSBuilder</tt> get complete and accurate information from the database.
 
The primary job of the <tt>DBWSBuilder</tt> utility is to extract metadata from the database about some artifact (i.e. a Table or a StoredProcedure) that is to be used as the basis of a Web Service. The <tt>DBWSBuilder</tt> translates the retrieved information (field names, arguments, scalar or composite datatypes, etc.) into DBWS runtime artifacts (EclipseLink Project XML files, WSDL and XML schema, etc.) Thus it is crucial that <tt>DBWSBuilder</tt> get complete and accurate information from the database.
 
+
</onlyinclude>
For Oracle databases, <tt>DBWSBuilder</tt> uses JPublisher (a cut-down version sans SQLJ support) that sends SQL queries to Data Dictionary views (<tt>ALL_OBJECTS</tt>, <tt>ALL_ARGUMENTS</tt>, etc.) whose results are then converted to an in-memory object-graph of all relevant information about that specific database artifact. This object-graph is then traversed and the required DBWS runtime artifacts generated.
+
</onlyinclude></span>
+
Unfortunately, the information in the Data Dictionary views can be (under certain circumstances) incomplete or inaccurate, or the object-graph can be distorted. For example, an argument to a StoredProcedure may have a default value assigned to it, thus making it optional. This in turn means that the calling sequence can change (fewer arguments need be passed in):
+
<source lang="plsql">
+
CREATE OR REPLACE PACKAGE SOMEPKG AS
+
  TYPE EMP_REC IS RECORD(
+
    EMPNO EMP.EMPNO%TYPE,
+
    FNAME EMP.FNAME%TYPE,
+
    LNAME EMP.LNAME%TYPE
+
  );
+
  PROCEDURE DOSOMETHING(MYREC IN OUT EMP_REC, STUFF IN VARCHAR2,
+
    P_EMPNO IN NUMBER := 20, FLAG IN BOOLEAN default FALSE,
+
    WHATEVER IN VARCHAR2 default 'bogus');
+
END;
+
</source>
+
The object-graph contains four StoredProcedure 'pseudo' representations:
+
<source lang="text">
+
DOSOMETHING(MYREC,STUFF)
+
DOSOMETHING(MYREC,STUFF, P_EMPNO)
+
DOSOMETHING(MYREC,STUFF, P_EMPNO, FLAG)
+
DOSOMETHING(MYREC,STUFF, P_EMPNO, FLAG, WHATEVER)
+
</source>
+
however, there are an additional four 'pseudo' representations '''not''' generated:
+
<source lang="text">
+
DOSOMETHING(MYREC,STUFF, FLAG)
+
DOSOMETHING(MYREC,STUFF, WHATEVER)
+
DOSOMETHING(MYREC,STUFF, FLAG, WHATEVER)
+
DOSOMETHING(MYREC,STUFF, P_EMPNO, WHATEVER)
+
</source>
+
This highlights an issue where the number of in-memory objects could expand geometrically at the rate of 2<sup>N</sup>. In addition, if the StoredProcedure <tt>DOSOMETHING</tt> was overloaded, the 'pseudo' representations could conflict.
+

Latest revision as of 16:14, 21 June 2011


The primary job of the DBWSBuilder utility is to extract metadata from the database about some artifact (i.e. a Table or a StoredProcedure) that is to be used as the basis of a Web Service. The DBWSBuilder translates the retrieved information (field names, arguments, scalar or composite datatypes, etc.) into DBWS runtime artifacts (EclipseLink Project XML files, WSDL and XML schema, etc.) Thus it is crucial that DBWSBuilder get complete and accurate information from the database.

Back to the top