---
schema_version: "1"
id: 5e7537e331a1150244ac1679f940e265f85957ad44e6a416dbc635aa1c71bcd8
title: Single Resource Transactions
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.6/single-resource-transaction.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.6/single-resource-transaction
source_site: docs.mulesoft.com
content_type: documentation
content_hash: ecb0d4e07793245f609dee79093bb17f2213a96a6f664ebb751397eed5475004
description: MuleSoft Documentation Site
release: "4.6"
latest: false
---
---
product: Mule Runtime
version: 4.6
keywords: anypoint studio, runtime, transaction, local, resource, single
---

# Single Resource Transactions

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Single Resource Transactions (also known as a simple transaction or local transaction) only use a
single resource to send or receive messages: JMS broker, VM queues, or JDBC connections.

The example below illustrates a flow which includes a single resource transaction performed using
the source and publish operations of the JMS connector.

```xml
<flow name="asdFlow" doc:id="2a67b1ee-0394-44a8-b6d9-9ce4f94f1ae2" >
	<jms:listener config-ref="JMS_Config" destination="test.in" transactionalAction="ALWAYS_BEGIN"/>
	<!-- Other operations -->
	<jms:publish config-ref="JMS_Config" destination="test.out" transactionalAction="ALWAYS_JOIN"/>
</flow>
```

> [!NOTE] Both the `jms:listener` source and the `jms:publish` operation must use the same
> connection configuration since this mechanism is intended to manage one resource.

The example shown above defines a JMS event source that receives messages from a `test.in` queue and
another JMS operation that sends messages to a `test.out` queue. The `transactionalAction` attribute
dictates how Mule initiates a transaction. Within this flow, Mule starts a new transaction for every
message it receives (`jms:listener` source), and always joins the transaction in progress for every
message it sends (`jms:publish` operation).

Mule only commits messages that successfully pass through the complete flow. If at any point in the
flow a message throws an error which is propagated (i.e. it is not handled by an
`on-error-continue`), Mule rolls back the transaction. Refer to
[On Error Scope](https://docs.mulesoft.com/mule-runtime/4.6/on-error-scope-concept) for details on how to handle errors.

## Nested Transactions

Nested transactions are not available for Single Resource transactions. Refer to
[XA Transactions](https://docs.mulesoft.com/mule-runtime/4.6/xa-transactions#nested-transactions) for more details.

## See Also

- [Transaction Management](https://docs.mulesoft.com/mule-runtime/4.6/transaction-management)
