Spring integration 如何在<;中指定架构名称;int jdbc:存储过程出站网关>;

Spring integration 如何在<;中指定架构名称;int jdbc:存储过程出站网关>;,spring-integration,Spring Integration,我们使用以下配置来执行Oracle存储过程。存储的进程(GET\u FRMA)位于schema->XX\u EMPROC中 我们有一个User->XX\u EMUSER,它已被授予存储进程的执行权限 我需要在下面的配置中指定schema name->XX_EMPROC <int-jdbc:stored-proc-outbound-gateway id="outbound-gateway-storedproc-get-forma" data-source="d

我们使用以下配置来执行Oracle存储过程。存储的进程(GET\u FRMA)位于schema->XX\u EMPROC中

我们有一个User->XX\u EMUSER,它已被授予存储进程的执行权限

我需要在下面的配置中指定schema name->XX_EMPROC

    <int-jdbc:stored-proc-outbound-gateway
            id="outbound-gateway-storedproc-get-forma" data-source="dataSource"
            is-function="false"
            stored-procedure-name="GET_FRMA"
            expect-single-result="true">

        <int-jdbc:sql-parameter-definition name="V_REF_ID" direction="IN" />
        <int-jdbc:sql-parameter-definition name="V_FRMA"   direction="OUT" type="#{T(oracle.jdbc.OracleTypes).CLOB}"/>

        <int-jdbc:parameter name="V_REF_ID" expression="payload" />
    </int-jdbc:stored-proc-outbound-gateway>

请注意,当使用user->XX\u EMPROC创建数据源时,它工作正常,但当我们使用user->XX\u EMUSER时,我们会得到以下错误

  • 错误:

嵌套异常为org.springframework.dao.InvalidDataAccessApiUsageException:无法确定正确的调用签名-没有“GET_FRMA”的过程/函数/签名

要让它工作,您应该指定
存储过程名称
和架构名称:

stored-procedure-name="XX_EMPROC.GET_FRMA"
但同时,您必须指定:

ignore-column-meta-data="true"
这意味着:

<xsd:attribute name="ignore-column-meta-data" default="false" use="optional">
        <xsd:annotation>
            <xsd:documentation>
                If true, the JDBC parameter definitions for the stored procedure
                are not automatically derived from the underlying JDBC connection. In
                that case you must specify all Sql parameter definitions explicitly
                using the 'sql-parameter-definition' sub-element.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:simpleType>
            <xsd:union memberTypes="xsd:boolean xsd:string" />
        </xsd:simpleType>
    </xsd:attribute>
结果证明:

/**
 * Initialize the database specific management of procedure column meta data.
 * This is only called for databases that are supported. This initialization
 * can be turned off by specifying that column meta data should not be used.
 * @param databaseMetaData used to retrieve database specific information
 * @param catalogName name of catalog to use (or {@code null} if none)
 * @param schemaName name of schema name to use (or {@code null} if none)
 * @param procedureName name of the stored procedure
 * @throws SQLException in case of initialization failure
 * @see org.springframework.jdbc.core.simple.SimpleJdbcCall#withoutProcedureColumnMetaDataAccess()
 */
void initializeWithProcedureColumnMetaData(DatabaseMetaData databaseMetaData, @Nullable String catalogName,
        @Nullable String schemaName, @Nullable String procedureName) throws SQLException;
这就是为什么我们有JIRA的票


但另一方面,自动
columnMetaData
会导致对DB的额外调用,这并不是一个事实,即结果将与您在应用程序中期望的结果一致。我建议始终关闭它。至少对Oracle来说是这样。

您是否尝试过:`storage procedure name=“XX_EMPROC.GET\FRMA"`? 对获取错误:消息处理程序[org.springframework.integration.handler.MessageHandlerChain#0$child.outbound gateway storedproc get forma.handler]中出错;嵌套异常为org.springframework.dao.InvalidDataAccessApiUsageException:无法确定“XX\u EMPROC.GET\u FRMA”的正确调用签名-应使用“.withCatalogName(\“XX\u EMPROC\”)确定”单独指定包名。如何
忽略列metadata=“true”
?现在它的工作:)非常感谢。。为什么它现在可以找到进程?
/**
 * Initialize the database specific management of procedure column meta data.
 * This is only called for databases that are supported. This initialization
 * can be turned off by specifying that column meta data should not be used.
 * @param databaseMetaData used to retrieve database specific information
 * @param catalogName name of catalog to use (or {@code null} if none)
 * @param schemaName name of schema name to use (or {@code null} if none)
 * @param procedureName name of the stored procedure
 * @throws SQLException in case of initialization failure
 * @see org.springframework.jdbc.core.simple.SimpleJdbcCall#withoutProcedureColumnMetaDataAccess()
 */
void initializeWithProcedureColumnMetaData(DatabaseMetaData databaseMetaData, @Nullable String catalogName,
        @Nullable String schemaName, @Nullable String procedureName) throws SQLException;