Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be 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/PLSQLStoredFunctions"

(Refactoring DatasourceCall Hierarchy)
(Refactoring DatasourceCall Hierarchy)
Line 10: Line 10:
  
 
In order to better handle complex PL/SQL datatypes as parameters, the <code>DatasourceCall</code> hierarchy needs to be refactored. In addition to 'starving' <code>StoredFunctionCall</code>'s from handling complex parameters, the current code <b><i>leaks</i></b> internal implementation details to the surrounding classes: a parameter's name is held in a separate array from the array that holds (at the same index) the <code>DatabaseFields</code>'s that describe the parameter. Additionally, the parameter at index <tt>0</tt> is 'special', representing the return argument for <code>StoredFunctionCall</code>'s. Finally, handling <tt>INOUT</tt> PL/SQL parameters have special handling needs as the anonymous PL/SQL blocks used to handle complex PL/SQL datatypes does not natively handle <tt>INOUT</tt> args. The args must be split into two parameters (dubbed IN_SYNTHETIC and OUT_SYNTHETIC) and argument-order must be re-computed as all OUT args must be after the IN args.
 
In order to better handle complex PL/SQL datatypes as parameters, the <code>DatasourceCall</code> hierarchy needs to be refactored. In addition to 'starving' <code>StoredFunctionCall</code>'s from handling complex parameters, the current code <b><i>leaks</i></b> internal implementation details to the surrounding classes: a parameter's name is held in a separate array from the array that holds (at the same index) the <code>DatabaseFields</code>'s that describe the parameter. Additionally, the parameter at index <tt>0</tt> is 'special', representing the return argument for <code>StoredFunctionCall</code>'s. Finally, handling <tt>INOUT</tt> PL/SQL parameters have special handling needs as the anonymous PL/SQL blocks used to handle complex PL/SQL datatypes does not natively handle <tt>INOUT</tt> args. The args must be split into two parameters (dubbed IN_SYNTHETIC and OUT_SYNTHETIC) and argument-order must be re-computed as all OUT args must be after the IN args.
 +
 +
=== Leaky Abstraction has leaked to: ===
 +
/org.eclipse.persistence.core/src/org/eclipse/persistence/queries < br/>
 +
Call < br/>
 +
SQLCall < br/>
 +
< br/>
 +
/org.eclipse.persistence.core/src/org/eclipse/persistence/eis/interactions/ < br/>
 +
EISInteraction < br/>
 +
IndexedInteraction < br/>
 +
MappedInteraction < br/>
 +
QueryStringInteraction < br/>
 +
XMLInteraction < br/>
 +
XQueryInteraction < br/>
 +
< br/>
 +
/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess < br/>
 +
DatasourceCall < br/>
 +
DatabaseCall < br/>
 +
ParameterizedSQLBatchWritingMechanism < br/>
 +
StoredProcedureCall < br/>
 +
StoredFunctionCall < br/>
 +
DatabasePlatform < br/>
 +
< br/>
 +
/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions < br/>
 +
SQLDeleteAllStatement < br/>
 +
SQLModifyAllStatementForTempTable < br/>
 +
SQLUpdateAllStatement < br/>
 +
SQLUpdateAllStatementForOracleAnonymousBlock < br/>
 +
SubSelectExpression < br/>
 +
SQLDeleteAllStatement < br/>
 +
SubSelectExpression < br/>
 +
< br/>
 +
/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/queries < br/>
 +
DatabaseQueryMechanism < br/>
 +
< br/>
 +
/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/factories < br/>
 +
ObjectPersistenceRuntimeXMLProject_11_1_1 < br/>
 +
 +
/org.eclipse.persistence.core/src/org/eclipse/persistence/platform/database < br/>
 +
OraclePlatform < br/>
 +
PostgreSQLPlatform < br/>
 +
 +
/org.eclipse.persistence.core/src/org/eclipse/persistence/tools/schemaframework < br/>
 +
StoredProcedureGenerator < br/>
 +
 +
/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/xr < br/>
 +
StoredFunctionQueryHandler < br/>

Revision as of 13:47, 3 February 2010

Complex PL/SQL datatypes as parameters (and return argument) for StoredFunctions

Requirements

Use of PL/SQL datatypes as parameters for StoredFunctions is required by JDev QA testing (a 'torture test' that tries every datatype). In addition, the issue has been raised on the Oracle TopLink forum.

Refactoring DatasourceCall Hierarchy

As described in bug 27516, the specific DatasourceCall behaviour that handles complex PL/SQL datatypes as parameters is in the PLSQLStoredProcedureCall class, making it un-available to any sub-class of StoredFunctionCall (i.e. PLSQLStoredFunctionCall)

Call classdiagram.png

In order to better handle complex PL/SQL datatypes as parameters, the DatasourceCall hierarchy needs to be refactored. In addition to 'starving' StoredFunctionCall's from handling complex parameters, the current code leaks internal implementation details to the surrounding classes: a parameter's name is held in a separate array from the array that holds (at the same index) the DatabaseFields's that describe the parameter. Additionally, the parameter at index 0 is 'special', representing the return argument for StoredFunctionCall's. Finally, handling INOUT PL/SQL parameters have special handling needs as the anonymous PL/SQL blocks used to handle complex PL/SQL datatypes does not natively handle INOUT args. The args must be split into two parameters (dubbed IN_SYNTHETIC and OUT_SYNTHETIC) and argument-order must be re-computed as all OUT args must be after the IN args.

Leaky Abstraction has leaked to:

/org.eclipse.persistence.core/src/org/eclipse/persistence/queries < br/> Call < br/> SQLCall < br/>

< br/>

/org.eclipse.persistence.core/src/org/eclipse/persistence/eis/interactions/ < br/> EISInteraction < br/> IndexedInteraction < br/> MappedInteraction < br/> QueryStringInteraction < br/> XMLInteraction < br/> XQueryInteraction < br/>

< br/>

/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/databaseaccess < br/> DatasourceCall < br/> DatabaseCall < br/> ParameterizedSQLBatchWritingMechanism < br/> StoredProcedureCall < br/> StoredFunctionCall < br/> DatabasePlatform < br/>

< br/>

/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/expressions < br/> SQLDeleteAllStatement < br/> SQLModifyAllStatementForTempTable < br/> SQLUpdateAllStatement < br/> SQLUpdateAllStatementForOracleAnonymousBlock < br/> SubSelectExpression < br/> SQLDeleteAllStatement < br/> SubSelectExpression < br/>

< br/>

/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/queries < br/> DatabaseQueryMechanism < br/>

< br/>

/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/factories < br/> ObjectPersistenceRuntimeXMLProject_11_1_1 < br/>

/org.eclipse.persistence.core/src/org/eclipse/persistence/platform/database < br/> OraclePlatform < br/> PostgreSQLPlatform < br/>

/org.eclipse.persistence.core/src/org/eclipse/persistence/tools/schemaframework < br/> StoredProcedureGenerator < br/>

/org.eclipse.persistence.dbws/src/org/eclipse/persistence/internal/xr < br/> StoredFunctionQueryHandler < br/>

Back to the top