Disable hibernate validator when creating the hibernate session factory

Description

Hibernate has a plugin mechanism that autodetects hibernate-validator if it is on the classpath and wires it in automagically.

This behaviour causes this bug:
https://github.com/corda/corda/issues/4444

The fix for this is to add hibernate-validator to the system classpath. (dropping it in the "/lib" folder)

The issue with that is that it might cause subtle bugs in CorDapps who depend on hibernate validator outside of the hibernate logic.

The proposed fix is to disable hibernate's plugin mechanism.

The drawback is that CorDapps will not be able to rely on hibernate validator to validate the Queryable State entities.
That is an antipattern anyway because the state should be well formed in the first place on the ledger.

Assignee

Tudor Malene

Reporter

Tudor Malene

Labels

Sprint

None

Epic Link

None

Priority

Medium

Engineering Teams

Kernel

Fix versions

Affects versions

Ported to...

Corda 4.1
Corda 4.3
Corda Enterprise 4
Corda Enterprise 4.1
Corda Enterprise 4.2
Corda Enterprise 4.0 Patch
Corda Enterprise 4.1 Patch
Corda Enterprise 4.2 patch

Story Points / Dev Days

None

Build cut

None
Configure