Yes, it still fails on every major version of ORM 4 (4.0.0, 4.1.0, 4.2.0, 4.3.0 and lastly, 4.3.5.Final).
I've added a new testcase that shows how it fails on 4.3.5.Final.
FWIW, my analysis: When creating and populating the EntityEntry object, a deepCopy is performed at TwoPhaseLoad:268. This causes the actual entity and the EntityEntry.loadedState property to contain different array instances with the same contents.
Later, when a flush occurs, DefaultFlushEntityEventListener.dirtyCheck :546 ends up calling persister.findDirty on line 546 , which in turn compares each property with TypeHelper.findDirty (line 4243) . Here, the Lobs are defined with type WrappedMaterializedBlobType, whose isEqual method is that of ByteArrayTypeDescriptor, which just use uses object equality (from its parent AbstractTypeDescriptor) , causing the different instances of both (content-wise) identical array arrays to be not equal.
I noticed that WrappedMaterializedBlobType replaced ByteArrayBlobType. ByteArrayBlobType does seem to contain the correct implementation of isEqual: it compares the contents of the array instead of relying on object equality.
|