マイライブラリドキュメント

マルチルートサイドバー

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를 전달합니다.

コレクション名付け
java

collection名がアプリケーションのライフサイクル中に完全に固定されている場合、DriverMongoExecutionContext.cachedCollectionNameResolver(...)を使用できます。tenant/request/timeに応じて名前が変わるresolverにはキャッシュヘルパーを使用しません。

セッションスコープとトランザクション

getTxJob(...)で作成されたClientSessionMongoExecutionContext#getSessionScope()が同じDSL実行にのみ伝播します。DriverMongoExecutionContextは基本的に自分のMongoClientをセッションスコープとして使用します。

© 2026 Byeolnaerim. 無断転載を禁じます。紹介プライバシーポリシー