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

EVA-3396 - Few small changes to enforce concerns regardless of the Spring context #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sundarvenkata-EBI
Copy link
Member

No description provided.

@@ -88,6 +90,8 @@ class EVADatabaseEnvironment {

def mc = context.getBean(MongoClient.class)
def mt = context.getBean(MongoTemplate.class)
mt.setReadPreference(ReadPreference.primary())
mt.setWriteConcern(WriteConcern.MAJORITY)
Copy link
Member Author

Choose a reason for hiding this comment

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

Based on the Spring context and application, these may not be fully enforced. So we are extra cautious here and explicitly setting them.

@@ -65,7 +65,7 @@ class RetryableBatchingCursor<T> implements Iterable<T> {
.causallyConsistent(true).build()
ClientSession session = null
try {
this.mongoTemplate.mongoDbFactory.getSession(sessionOptions)
session = this.mongoTemplate.mongoDbFactory.getSession(sessionOptions)
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure how the code worked without this so far!

@sundarvenkata-EBI sundarvenkata-EBI changed the title EVA-3399 - Few small changes to enforce concerns regardless of the Spring context EVA-3396 - Few small changes to enforce concerns regardless of the Spring context Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants