I have the following class:
The join table ec_resource_pool_resource and the audit table ec_resource_pool_resource_aud both have case-insensitive collation order.
I create a resource pool whose m_resourceNames with some id which contains the entry 'foo', which produces a row in ec_resource_pool_resource with that id and resource_name = 'foo'
I then do:
resourcePool.add("FOO"); // Differs from the previous value only by case
When I attempt to commit this, I get a constraint violation and my transaction rolls back, because Envers is trying to add a DEL and ADD record to ec_resource_pool_resource_aud for the same revision and resource pool id that differ only by the case of the resource name string value, but the primary key index on ec_resource_pool_resource (of the three columns rev, the id, and the resource name) is case independent, so it considers these two primary key values to be identical.
This problem didn't happen back in Hibernate 4.3.x.
I haven't yet turned this into a test case – hopefully I'll be able to do so fairly soon.