Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

Transaction support

The PostgreSQL transport supports the following transport transaction modes:

  • Transport transaction - Send atomic with receive
  • Transport transaction - receive only
  • Unreliable (transactions disabled)

TransactionScope mode is not supported because the implementation of TransactionScope in npgsql (ADO.NET driver for PostgreSQL) may lead to logical message loss (an update to a database that is prepared and persisted but not actually applied to the data tables).

Native transactions

In this mode, the message is received inside a native ADO.NET transaction. There are two available options within native transaction level:

  • ReceiveOnly - An input message is received using native transaction. The transaction is committed only when message processing succeeds.
  • SendsAtomicWithReceive - This mode is similar to the ReceiveOnly, but transaction is shared with sending operations. That means the message receive operation and any send or publish operations are committed atomically.

Unreliable (transactions disabled)

In this mode, when a message is received it is immediately removed from the input queue. If processing fails the message is lost because the operation cannot be rolled back. Any other operation that is performed when processing the message is executed without a transaction and cannot be rolled back. This can lead to undesired side effects when message processing fails part way through.