---
title: "db:transaction — Transaction"
description: "iXML command db:transaction: Transaction."
canonical_url: "https://www.zeyos.com/ixml/ref/db-transaction"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/db-transaction.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# db:transaction — Transaction

DB:TRANSACTION specifies a transaction block for database and binary data store operations, ensuring that such processes leave the database and the binary data store in a consistent state even if an error occures within the transaction.

Transactions provide an all-or-nothing proposition, stating that each work-unit performed within a transaction must either complete in its entirety or have no effect whatsoever.

### Attributes
- (none)

### Children
- (none)

### Parents
- db:connection

### Result
- (none documented)

### Examples

```xml
<db:set entity="contacts" id="123" var_data="obj"/>

<try>
	<db:transaction>
		<db:set entity="contacts" id="123">
			<db:data field="lastname">New</db:data>
		</db:set>

		<error/>
	</db:transaction>

	<catch/>
</try>

<db:get var="obj" entity="contacts" id="123">
	<db:field>lastname</db:field>
</db:get>

<output>$obj.lastname</output>

<!-- Old -->
```
