My workaround was just to optimize out the problematic mapCollectionChanges section at AbstractCollectionMapper.mapModifiedFlagsToMapFromEntity(... Object newObj, Object oldObj) when newObj and oldObj are the same instance. Better fix would haven be to follow Hibernate Search approach and just catch the LazyInitializationException and continue as-if nothing happened, but currently it's not possible without tampering with AbstractPersistentCollection.read() method (see https://github.com/ShawnClowater/hibernate-orm/commit/2b4fdfee0335551adde2d6f9cb63f64fe17a8c25).
|