AI agents: use the documentation index at llms.txt to locate machine-readable pages. This section is indexed by https://docs.particular.net/persistence/llms.txt. The markdown version of this page is served as plain text. An MCP server at /mcp serves the same content via the search_docs and read_doc tools; it is read-only and needs no credentials. Markdown versions of documentation pages are available by appending .md to the page URL. Directory URLs use index.md. They are served as text/plain because some retrieval backends reject text/markdown.

Combining PostgreSQL Persistence and Transport

Component:
Sql Persistence
Target Version:
NServiceBus 9.x

When using SQL persistence using the PostgreSQL dialect in combination with the PostgreSQL transport, the location of saga data depends both on whether the outbox is enabled and on the transaction mode.

Outbox disabled

PostgreSQL Transport
TransactionMode
Connection sharingSaga data location
SendsAtomicWithReceiveisolated transaction for send and receiveTransport DB
ReceiveOnlyisolated transaction for receiveTransport DB
NoneNo transactionsPersistence DB

With the outbox disabled, the persistence uses the connection and transaction context established by the transport to access saga data. This behavior ensures exactly-once message processing, since the state change of a saga is committed atomically with the consumption of the message that caused it.

This behavior may be disabled, to force the persistance to create its own connection, as it does when the outbox is enabled:

var persistence = endpointConfiguration.UsePersistence<SqlPersistence>();
var dialect = persistence.SqlDialect<SqlDialect.PostgreSql>();
dialect.DoNotUsePostgreSqlTransportConnection();

Outbox enabled

PostgreSQL Transport
TransactionMode
Connection sharingSaga data location
SendsAtomicWithReceiveNot supportedN/A
ReceiveOnlyvia Transport storage contextPersistence DB
NoneNot supportedN/A

Related Articles