Skip to content
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

FEAT / Added config to disable attempt to update before insert in cache #1787

Merged
merged 1 commit into from
Jul 15, 2022

Conversation

Milton-Ch
Copy link
Contributor

Description

Added config to disable attempt to update before insert in cache.

Target issue

#207

@mo-auto mo-auto added the comp-jans-core Component affected by issue or PR label Jul 13, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jul 13, 2022

[jans-core] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Milton-Ch Milton-Ch marked this pull request as ready for review July 13, 2022 18:44
@@ -82,6 +82,9 @@ public void create() {
// CouchbaseEntryManagerFactory.PERSISTENCE_TYPE
skipRemoveBeforePut = "couchbase".equals(persistenceType);
attemptUpdateBeforeInsert = "sql".equals(persistenceType);
if (cacheConfiguration.getNativePersistenceConfiguration().isDisableAttemptUpdateBeforeInsert()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don't need explicit configuration for it. Existing attemptUpdateBeforeInsert = "sql".equals(persistenceType); is enough. With this we already updating entry (for all further calls except initial one).

@yurem is it what you meant in #207 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I talked with him before doing these changes, but let's see Yure's feedback in case I misunderstood something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, for #207 we already updated code. But this new property will allow us to check at runtime which approach is better for specific DB MySQL/Postgress/etc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, yes, it can be useful.

@@ -82,6 +82,9 @@ public void create() {
// CouchbaseEntryManagerFactory.PERSISTENCE_TYPE
skipRemoveBeforePut = "couchbase".equals(persistenceType);
attemptUpdateBeforeInsert = "sql".equals(persistenceType);
if (cacheConfiguration.getNativePersistenceConfiguration().isDisableAttemptUpdateBeforeInsert()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, for #207 we already updated code. But this new property will allow us to check at runtime which approach is better for specific DB MySQL/Postgress/etc

@yuriyz yuriyz merged commit d9a07ff into main Jul 15, 2022
@yuriyz yuriyz deleted the feat/cache-configuration-sql branch July 15, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-core Component affected by issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants