We have issue with perfomance of updating map collection under heavy load. Our collection mapping:
@MapKeyJoinColumn( name = "poi", nullable = false )
@JoinTable( name = "mon_race_poi_arrival",
private Map<Poi, PoiArrival> poiArrival;
For workarounding HHH-7072 Closed you are always recreate collection if there is no not null property in collection element (methods org.hibernate.action.internal.CollectionUpdateAction#execute and org.hibernate.collection.internal.AbstractPersistentCollection#needsRecreate).
But if there is indexed collection (list or map), this recreation can be avoided, because index property is usualy is not null, and it is used in where condition for updates instead of element values.
Fixing this can be easy - just override method needsRecreate in PersistentMap and PersistentList, like you are already do in PersistentBag.
Or rewrite common method in AbstractPersistentCollection to check nullability of index column.