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 ends up calling persister.findDirty on line 546, which in turn compares each property with TypeHelper.findDirty. Here, the Lobs are defined with type WrappedMaterializedBlobType, whose isEqual method is that of ByteArrayTypeDescriptor, which just use object equality, causing the different instances of both identical array 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.
|