Skip to content

CodecRegistry not considered on a per-query basis [DATAMONGO-2557] #3412

Closed
@spring-projects-issues

Description

@spring-projects-issues

rougou opened DATAMONGO-2557 and commented

I have a multi-tenant spring boot application that overrides getMongoDatabase to switch the database depending on the current tenant. I think it is a fairly common implementation.

After upgrading to Spring Boot 2.3 and Spring Data Mongo 3.0, I found a database call is now made at application startup for any @Query annotation. This prevents my app from even starting up since the database cannot be determined at that point.

Below is the line of code in question:

CodecRegistry codecRegistry = mongoOperations.execute(MongoDatabase::getCodecRegistry);

 

Thanks


Affects: 3.0 GA (Neumann)

Issue Links:

  • DATAMONGO-1894 Use reactive subscriber context for SpEL evaluation in query execution
    ("depends on")

Referenced from: pull request #879

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions