CORDA-2934 - disable hibernate validator integration with hibernate (#5130) (#5144)

(cherry picked from commit 688c742706)
This commit is contained in:
Tudor Malene 2019-06-21 09:33:37 +01:00 committed by Katelyn Baker
parent 6bef2b52e7
commit e8b55e8f2e
2 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,12 @@ Unreleased
* Fix a bug in Corda 4.0 that combined commands in ``TransactionBuilder`` if they only differed by the signers list. The behaviour is now consistent with prior Corda releases.
* Disabled the default loading of ``hibernate-validator`` as a plugin by hibernate when a CorDapp depends on it. This change will in turn fix the
(https://github.com/corda/corda/issues/4444) issue, because nodes will no longer need to add ``hibernate-validator`` to the ``\libs`` folder.
For nodes that already did that, it can be safely removed when the latest Corda is installed.
One thing to keep in mind is that if any CorDapp relied on hibernate-validator to validate Querayable JPA Entities via annotations, that will no longer happen.
That was a bad practice anyway, because the ``ContractState`` should be validated in the Contract verify method.
.. _changelog_v4.0:
Version 4.0

View File

@ -89,6 +89,7 @@ class HibernateConfiguration(
val config = Configuration(metadataSources).setProperty("hibernate.connection.provider_class", NodeDatabaseConnectionProvider::class.java.name)
.setProperty("hibernate.format_sql", "true")
.setProperty("hibernate.hbm2ddl.auto", hbm2dll)
.setProperty("javax.persistence.validation.mode", "none")
.setProperty("hibernate.connection.isolation", databaseConfig.transactionIsolationLevel.jdbcValue.toString())
schemas.forEach { schema ->