Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade postgresql-jdbc and spring-jdbc versions #322

Merged
merged 2 commits into from
May 10, 2022

Commits on May 10, 2022

  1. Upgrade postgresql-jdbc and spring-jdbc versions

    oVirt stopped working after upgrading from postgrsql-jdbc 42.2.3 to
    42.2.14
    
    The reason for that was that in 42.2.11
    PgDatabaseMetaData.java:getProcedures stopped to return Functions and
    returns only Procedures.
    The difference in Postgres between a Function and a Procedure is that a
    Function returns a value to the caller while a Procedure only executes
    commands and does not has a return value.
    We are using only Functions and if we have nothing to return we still
    return VOID which makes this code to be categorized as a Function.
    
    We are using spring-jdbc 5.0.4.RELEASE, but this version is not aligned
    with the postgresql >= 42.2.11 changes and  calls only PgDatabaseMetaData.getProcedures() in spring-jdbc
    GenericCallMetaDataProvider::initializeWithProcedureColumnMetaData
    and therefor brings an empty results.
    
    We have to upgrade to  spring-jdbc 5.2.10.RELEASE which calls also
    PgDatabaseMetaData.getFunctions and builds a complete metadata.
    
    However, upgarding to postgrsql 42.2.14 and spring-jdbc 5.2.10.RELEASE
    was not enough. Now we have some errors in our DB testing :
    
    [ERROR] Errors:
    [ERROR]   ClusterDaoTest.testClearAllUpgradeRunning:433 » InvalidDataAccessApiUsage Requ...
    [ERROR]   ClusterDaoTest.testClearUpgradeRunning:418 » InvalidDataAccessApiUsage Require...
    [ERROR]   ClusterDaoTest.testFailureSetUpgradeRunning:409 » InvalidDataAccessApiUsage Re...
    [ERROR]   ClusterDaoTest.testSetUpgradeRunning:397 » InvalidDataAccessApiUsage Required ...
    [ERROR]   VmDynamicDaoTest.testUpdateConsoleUserWithOptimisticLockingFailure:123 » InvalidDataAccessApiUsage
    [ERROR]   VmDynamicDaoTest.testUpdateConsoleUserWithOptimisticLockingSuccess:109 » InvalidDataAccessApiUsage
    
    All those methods calls a function that returns a value that is stored
    in OUT parameter.
    The reason for the failure is that the upgraded versions now requires to define
    explicitly any OUT parameter, complaining that the parameter is not
    recognized.
    
    In order to solve that now we have a new
    SimpleJdbcCallsHandler::executeModification signature that can accept
    also 2 additional parameters as the OUT parameter name and its
    java.sqlTypes type value (int) and defines the OUT parameter as
    required.
    
    Any other call to executeModification is not affected including batch
    processing that is used only for async calls and don't use return
    values.
    
    This patch affect other projects that uses postgresql-jdbc and
    spring-jdbc to handle DB calls.
    
    The changes required are:
    
    1. change postgresql-jdbc to use version 42.2.14
    2. change spring-jdbc to use version 5.2.10.RELEASE
    3. for each Function that uses OUT parameter use SimpleJdbcCallsHandler.
    executeModification(final String procedureName,
                final MapSqlParameterSource paramSource,
                String outParamName,
                Integer outParamType)
    instead of:
    executeModification(final String procedureName, final MapSqlParameterSource paramSource)
    
    Signed-off-by: Eli Mesika <emesika@redhat.com>
    Bug-Url: https://bugzilla.redhat.com/2077794
    emesika authored and michalskrivanek committed May 10, 2022
    Configuration menu
    Copy the full SHA
    c1e169c View commit details
    Browse the repository at this point in the history
  2. Bump Spring Framework to 5.3.19

    Bumps Spring Framework to 5.3.19 and adds requirement for
    ovirt-dependencies >= 4.5.2 which contains that Spring Framework
    version.
    
    Bug-Url: https://bugzilla.redhat.com/2077794
    Signed-off-by: Martin Perina <mperina@redhat.com>
    mwperina committed May 10, 2022
    Configuration menu
    Copy the full SHA
    9670a86 View commit details
    Browse the repository at this point in the history