-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 544202 - Fix CacheKey.protectedForeignKeys update #369
base: master
Are you sure you want to change the base?
Conversation
Issue tracker reference: |
1 similar comment
Issue tracker reference: |
* | ||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | ||
******************************************************************************/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you follow the convention used in other files wrt formatting of license header? I do not think this is going to pass the copyright check - verify by running mvn -Pcoding-standards glassfish-copyright-mave-plugin:check
or mvn -Pcoding-standards glassfish-copyright-mave-plugin:copyright
(the latter will show wrong files but won't fail the build in case of errors) - note that the check may take up to 2hours to finish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @lukasj, thank you for your attention, I fixed the copyright as you suggested.
I ran:
mvn -X -Pcoding-standards glassfish-copyright:copyright -pl foundation/org.eclipse.persistence.core
And can confirm it ends with a BUILD SUCCESS
and no reported errors.
I rebased master on my branch in order to be up to date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated PR's description. Everything was already in bugzilla + test case but it's better to sum up here for future reference
Signed-off-by: Alexandre Jacob <[email protected]>
Problem
There is an issue with 2nd level cache and
@NonCacheable
where a relationship could be not refreshed correctly.To reproduce this problem you need:
eclipselink.cache.shared.default
false
)EntityA
configured for 2nd level caching (eclipselink.cache.shared.EntityA
true
)EntityB
not configured for 2nd level (default)EntityA
needs to have a relation (tested with@ManyToOne
) withEntityB
, this relation needs to be annotated with@Noncacheable
.If you fetch an instance of
EntityA
a1
linked with an instance ofEntityB
b1
, and then you updatea1
to be linked withb2
, foreign key cache will not be updated correctly anda1
will remain linked withb1
.The first attempt to re-load
a1
will bring correctlyb2
but all subsequent calls will bring backb1
.Solution
Fixed this problem by updating foreign key values when CacheKey is in
CACHE_KEY_INVALID
state.