diff --git a/effect/architecture.md b/effect/architecture.md index 7094c03..c19ce23 100644 --- a/effect/architecture.md +++ b/effect/architecture.md @@ -79,7 +79,7 @@ The `Run` method wraps the user-defined method (`Junctions()` or `RunInternal`) The `EffectRunner` coordinates all registered effect providers. It builds its provider list at construction time by querying `IEffectProviderFactory` instances filtered through the `IEffectRegistry`. -It exposes three operations that fan out to every active provider: +It exposes three operations that fan out to every active provider, awaiting each provider sequentially: - **`Track(model)`** — Register a new model for tracking (e.g., add `Metadata` to the EF change tracker) - **`Update(model)`** — Notify providers of an in-memory mutation (e.g., re-serialize parameters after output is set) - **`SaveChanges(ct)`** — Persist all accumulated changes across all providers @@ -173,7 +173,7 @@ Junctions execute inside the "Execute Train Chain" box. Each mutation to the tra ### DataContext -`DataContext` extends EF Core's `DbContext` and implements both `IDataContext` and `IEffectProvider`. It maps `Track` → `Add`, `Update` → EF `Update`, and `SaveChanges` → `SaveChangesAsync`, delegating persistence to EF Core's change tracker. It also provides transaction support via `BeginTransaction`, `CommitTransaction`, and `RollbackTransaction`. +`DataContext` extends EF Core's `DbContext` and implements both `IDataContext` and `IEffectProvider`. It maps `Track` and `Update` to direct entity state assignment (Added for new entities, Modified for existing), and `SaveChanges` to `SaveChangesAsync`. State is set on the target entity only — navigation properties are not traversed, which prevents unnecessary UPDATE statements when entities cross DI scope boundaries (e.g., metadata loaded by `LoadMetadataJunction` passed into a child train's context). It also provides transaction support via `BeginTransaction`, `CommitTransaction`, and `RollbackTransaction`. **DbSets:** diff --git a/sdk-reference/scheduler-api/add-trax-job-runner.md b/sdk-reference/scheduler-api/add-trax-job-runner.md index 8130a0d..26b0c89 100644 --- a/sdk-reference/scheduler-api/add-trax-job-runner.md +++ b/sdk-reference/scheduler-api/add-trax-job-runner.md @@ -167,7 +167,7 @@ Maps a `POST` endpoint at the specified route that: 3. Creates a new DI scope and resolves `IJobRunnerTrain` 4. Calls `Run(new RunJobRequest(metadataId, input))` 5. Returns `200 OK` with a `RemoteJobResponse` containing the metadata ID on success -6. On error: returns `200 OK` with `RemoteJobResponse.IsError = true` and structured error fields (`ErrorMessage`, `ExceptionType`, `StackTrace`) +6. On error: logs the exception, then returns `200 OK` with `RemoteJobResponse.IsError = true` and structured error fields (`ErrorMessage`, `ExceptionType`, `StackTrace`) ### UseTraxRunEndpoint diff --git a/sdk-reference/scheduler-api/trax-lambda-function.md b/sdk-reference/scheduler-api/trax-lambda-function.md index 1a67d34..ac36b74 100644 --- a/sdk-reference/scheduler-api/trax-lambda-function.md +++ b/sdk-reference/scheduler-api/trax-lambda-function.md @@ -164,9 +164,9 @@ To minimize cold start time: ## Error Handling -For `Execute` requests, exceptions are caught and returned as a `RemoteJobResponse` with structured error fields (`IsError`, `ErrorMessage`, `ExceptionType`, `StackTrace`). The `LambdaJobSubmitter` on the scheduler side does not read this response (fire-and-forget), but the error is persisted in the Lambda function's metadata. +For `Execute` requests, exceptions are logged and returned as a `RemoteJobResponse` with structured error fields (`IsError`, `ErrorMessage`, `ExceptionType`, `StackTrace`). Errors that occur within the train itself are also persisted to the `Metadata` table by `ServiceTrain.Run`. However, pre-train errors (e.g., deserialization failures) only appear in the log output. The `LambdaJobSubmitter` on the scheduler side does not read the response (fire-and-forget). -For `Run` requests, `ITraxRequestHandler.RunTrainAsync` returns a `RemoteRunResponse` that may contain structured error fields. The `LambdaRunExecutor` on the scheduler side reads the response and reconstructs a `TrainException` with the full error context. +For `Run` requests, exceptions are logged before being rethrown. `ITraxRequestHandler.RunTrainAsync` returns a `RemoteRunResponse` that may contain structured error fields. The `LambdaRunExecutor` on the scheduler side reads the response and reconstructs a `TrainException` with the full error context. ## See Also