Skip to main content

createMemoryUnitOfWork

@forge/monorepo


@forge/monorepo / backend/src / createMemoryUnitOfWork

Function: createMemoryUnitOfWork()

createMemoryUnitOfWork(): UnitOfWork & object

Defined in: backend/src/adapters/memory/sessions.ts:131

Memory UnitOfWork with explicit compensation: the body registers rollbacks; if it throws, they run in reverse. Real Postgres uses an actual transaction — this gives the reference adapter the same all-or-nothing guarantee (session-state write and run finalization commit together or not at all). Use runTx to receive the rollback context; run satisfies the bare port.

Returns

UnitOfWork & object