View source | View content page | Page history | Printable version   

Projects:Upgrade To Hibernate 5.4/Specs

Back button.png   Back to Projects:Upgrade_To_Hibernate_5.4



The goal of this project is to upgrade the current Hibernate version used in Openbravo (5.3.2) to the latest stable version (5.4.2).

Functional Requirements

This project will not add new functional features, the changes involved within this project should be transparent in terms of the functional behavior of the application.

Technical Specs

Library Management

The main changes of this projects are related to the management of the required libraries. For upgrading Hibernate, the standard library upgrade process must be applied. Visit here to see a complete summary of the libraries involved in the upgrade.

Note that the jaxb library is going to be updated as part of this project. Thus, the illegal access warning caused by the version present in pi so far (jaxb-impl-2.2.6) will be fixed.

Changes Affected by the Upgrade

NativeQuery Return Type Problems

Hibernate version 5.3.2 allowed to specify a "primitive" return type when executing an SQL native query. This feature introduced regressions and for this reason it was reverted in version 5.3.3.

For this reason specifying a return type when building a NativeQuery is not supported. This has been documented here.

Hibernate Pool Validation Thread

In Hibernate 5.3.2, the Hibernate Pool Validation Thread was not set as daemon thread which caused some issues:

This was fixed in Hibernate 5.4. Therefore the fixes for these issues can be safely reverted as part of this project.

After reviewing the Migration Guide we have confirmed that, apart from the already mentioned ones, no additional changes are required. There is not a very big leap between versions 5.3 and 5.4 because version 5.4 mainly introduces bug fixes.

Method Chaining in OBQuery and OBCriteria

As part of this project, the methods that helps to build an OBQuery/OBCriteria will be modified in order to return the instance being built instead of void. Thus, these classes now will be aligned with Hibernate's Query class, as they will allow to use method chaining.

Note that these changes result in an ABI change: it does not affect source code compatibility (it will not break any compilation) but it indeed breaks binary compatibility (i.e. OBQuery/OBCriteria related bytecodes that were previously compiled against the old API will no longer run).

Retrieved from ""

This page has been accessed 785 times. This page was last modified on 17 April 2019, at 10:44. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.