My Library Docs

Multi-root Sidebar

flex-layout

  • Getting Started

  • Guides

  • Reference

typed-rx-http

  • Getting Started

  • Guides

  • Reference

global-rx-state

  • Getting Started

  • Guides

  • Reference

webflux-fe-dev-assistant

reactive-mongo-dsl

Execution Context & Resolver

Describes how MongoTemplateResolver selects MongoExecutionContext by key and how DriverMongoExecutionContext provides database, session, and mapping boundaries.


MongoTemplateResolver contract
MongoTemplateResolver.java
java

ReactiveMongoDsl<K>는 key마다 MongoExecutionContext를 가져옵니다. MongoExecutionContextMongoDatabase, ClientSession, collection naming, entity ↔ Document mapping과 save lifecycle hook의 경계를 담당합니다.

DriverMongoExecutionContext
java

기본 collection 이름은 entity simple class name을 decapitalize해서 결정합니다. 프로젝트의 실제 naming 규칙이 다르면 생성자에 collection-name resolver를 전달합니다.

Collection naming
java

If the collection name is completely fixed during the application lifetime, you can use DriverMongoExecutionContext.cachedCollectionNameResolver(...). Do not use cache helper for resolvers that change names based on tenant/request/time.

Session scope and transaction

The ClientSession created in getTxJob(...) is propagated only to the same DSL execution by MongoExecutionContext#getSessionScope(). DriverMongoExecutionContext uses its own MongoClient as the session scope by default.

© 2026 Byeolnaerim. All rights reserved.IntroductionPrivacy Policy