-
Notifications
You must be signed in to change notification settings - Fork 261
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
Conversation
It needs to be tested together with oVirt/ovirt-dependencies#10 and oVirt/ovirt-system-tests#137 |
OST run 35865 using #322 and oVirt/ovirt-dependencies#10 and oVirt/ovirt-system-tests#137 failed on some UI test, but not database errors in the log, so the patch seems to be OK. |
Current patch is for master branch, right? Why wait? |
because we want to sort out RHV builds too |
fixes #334 |
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
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>
As a part of oVirt#322 ovirt-engine now requires postgresql-jdbc >= 42.2.14, whih should be the latest version available. But unfortunately we forgot to add RPM requires for this version, which caused issues around upgrade. Bug-Url: https://bugzilla.redhat.com/2077794 Signed-off-by: Martin Perina <mperina@redhat.com>
As a part of #322 ovirt-engine now requires postgresql-jdbc >= 42.2.14, whih should be the latest version available. But unfortunately we forgot to add RPM requires for this version, which caused issues around upgrade. Bug-Url: https://bugzilla.redhat.com/2077794 Signed-off-by: Martin Perina <mperina@redhat.com>
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:
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