DeferredChangeDetectionPolicy.calculateChanges() Bug in Code? #1874
Closed
numeralnathan
started this conversation in
General
Replies: 1 comment
-
I was able to determine that EclipseLink has a bug. I created an issue and I am closing this discussion. |
Beta Was this translation helpful? Give feedback.
0 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
I am looking at line 129 in DeferredChangeDetectionPolicy. I am wondering if
modifyVersionField != null
should bemodifyVersionField == null
.https://github.com/eclipse-ee4j/eclipselink/blob/master/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/descriptors/changetracking/DeferredChangeDetectionPolicy.java#L129
I ask this because
clone
is an object that was only read from the database and none of the fields were read or changed. Thus, its @Version field shouldn't need to increment. It is never used with any of the other objects in the transaction. The second line above setsmodifyVersionField
to false. The third line evaluates to true. The 5ᵗʰ line does not findclone
in the cumulative unit of work change set and somodifyVersionField = Boolean.TRUE
executes.What do I not understand? Should
modifyVersionField != null
be changed tomodifyVersionField == null
because this is a bug? Should theclone
object be added to the cumulative unit of work change set when reading the object from the DB or cache? Do I need to change some of the annotations on theclone
object so that its @Version field is not incremented?Beta Was this translation helpful? Give feedback.
All reactions