Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-820

Configuration info for Command Parameters should include an "index"

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • Java-SCA-M2
    • Java DAS RDB
    • None

    Description

      The configuration for command parameters should include an index. As an example, the current SP example with an OUT parameter has the following associated config file:

      <Config xsi:noNamespaceSchemaLocation="http:///org.apache.tuscany.das.rdb/config.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

      <Command name="getNamedCustomers" SQL="

      {call GETNAMEDCUSTOMERS(?,?)}

      " kind="procedure">
      <Parameter direction="IN" columnType="commonj.sdo.String"/>
      <Parameter direction="OUT" columnType="commonj.sdo.IntObject"/>
      </Command>

      </Config>

      In keeping with our philosophy that only config that needs to vary from the defaults should be provided, the first parameter should not need to be defined since it is of the default IN type. However, removing the first parameter definition results in the following error.

      --------------------
      java.lang.RuntimeException: SQL Exception: Parameter 1 cannot be registered as an OUT parameter because it is an IN parameter.
      at org.apache.tuscany.das.rdb.impl.SPCommandImpl.executeQuery(SPCommandImpl.java:73)
      at org.apache.tuscany.das.rdb.test.StoredProcs.testGetNamedCustomers(StoredProcs.java:116)
      --------------------

      I assume this error is caused by the runtime inferring index positionally from the config input and the first parameter is necessary as a place holder in order for the OUT parameter to properly have an index of 2.

      Attachments

        Activity

          People

            bdaniel Brent Daniel
            kwilliams Kevin Joe Williams
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: