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

MongoTemplateResolver가 key별 MongoExecutionContext를 선택하고 DriverMongoExecutionContext가 database, session, mapping 경계를 제공하는 방식을 설명합니다.


MongoTemplateResolver 계약
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

collection 이름이 애플리케이션 수명 동안 완전히 고정인 경우 DriverMongoExecutionContext.cachedCollectionNameResolver(...)를 사용할 수 있습니다. tenant/request/time에 따라 이름이 바뀌는 resolver에는 캐시 helper를 사용하지 않습니다.

Session scope와 transaction

getTxJob(...)에서 만든 ClientSessionMongoExecutionContext#getSessionScope()가 같은 DSL 실행에만 전파됩니다. DriverMongoExecutionContext는 기본적으로 자신의 MongoClient를 session scope로 사용합니다.

© 2026 Byeolnaerim. All rights reserved.소개개인정보처리방침