Path: redb/redb.Templates/templates/route-xml/redb-route-sql-batch/.template.config/agents-scenario.md Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Templates/templates/route-xml/redb-route-sql-batch/.template.config/agents-scenario.md ---- SQL batches (`redb.Route.Sql`), `routes/orders.route.xml`: a timer sends single orders (headers `orderId`, `amount`) to `seda://modulectx-orders`; `` makes a batch, and one `sql:INSERT ...?batchSize=100&breakBatchOnError=false` writes it in one transaction, each item binding `:#orderId` and `:#amount` from its own headers. A row the database refuses (the table has `CHECK (amount >= 0)`) is undone under its savepoint and listed in `redbSql.batchErrors`. The connection is the bean `main-db` in `context.xml` with `ProviderName` `Microsoft.Data.Sqlite`, `Npgsql` or `Microsoft.Data.SqlClient`. Key: `db.connection` (SQLite has a default file). Usually changed: the table and the columns; `completionSize` and `completionTimeout` (rows per transaction); `breakBatchOnError` left out for all-or-nothing batches. `routes/OrdersBatchRoute.cs` writes the same table in C# on its own timer (`batch.period`): the body is a `List` of a C# record and `:#orderId`, `:#amount` bind from its properties; no aggregator.