> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/jdbc/transactionreleasesavepoint.md). Agents can also search and read this documentation through its [MCP server](https://boxlang.ortusbooks.com/~gitbook/mcp).

# TransactionReleaseSavepoint

Release a named transaction savepoint without committing or rolling back changes.

Releases a savepoint in the current transaction. This is optional cleanup: it discards a recovery boundary without committing or rolling back database changes.

{% hint style="info" %}
Added in BoxLang 1.19.0 (currently unreleased). See the [1.19.x release notes](https://boxlang.ortusbooks.com/readme/release-history/1.19.0.md).
{% endhint %}

## Method Signature

```js
transactionReleaseSavepoint( savepoint )
```

### Arguments

| Argument    | Type     | Required | Description                                                                                               | Default |
| ----------- | -------- | -------- | --------------------------------------------------------------------------------------------------------- | ------- |
| `savepoint` | `string` | `true`   | Name of an existing savepoint in the current transaction. Names are case-insensitive and cannot be blank. |         |

### Returns

`null`.

## Behavior

* Release invalidates the named savepoint and every savepoint created after it. Earlier savepoints remain available.
* A released name can be used again with `transactionSetSavepoint()`.
* Rolling back to a named savepoint keeps that target available, so it can then be released. Committing, fully rolling back, or ending the outer transaction clears all savepoints.
* Savepoints created before the first query are pending. Releasing a pending savepoint updates the registry without acquiring a database connection or choosing a datasource.
* Once a connection exists, release calls JDBC `Connection.releaseSavepoint()`. The JDBC driver must support this operation.
* When nested transactions are enabled, a child can release its own savepoints; it cannot use this function to release a parent's savepoint.

### Errors

An active transaction is required. A blank, missing, released, or otherwise invalidated savepoint name raises an error. Unsupported JDBC release and other JDBC failures raise a `DatabaseException`; a failed JDBC release leaves the savepoint handles available for recovery.

Unlike this function, the `transaction action="releasesavepoint"` component action is silently ignored outside an active transaction, matching the component's other non-begin actions.

## Examples

### Release after successful work

This example assumes a configured default datasource and an existing `products` table. The update is committed when the outer transaction completes successfully. Releasing the savepoint does not commit it early.

```js
transaction {
	transactionSetSavepoint( "beforeUpdate" )
	queryExecute( "UPDATE products SET price = ? WHERE id = ?", [ { value: 19.99, sqltype: "decimal", scale: 2 }, 42 ] )
	transactionReleaseSavepoint( "beforeUpdate" )
}
```

### Roll back, release, and reuse a name

The first update is rolled back. The second update is retained if the outer transaction completes successfully.

```js
transaction {
	transactionSetSavepoint( "item" )
	queryExecute( "UPDATE products SET price = ? WHERE id = ?", [ { value: 19.99, sqltype: "decimal", scale: 2 }, 42 ] )
	transactionRollback( "item" )
	transactionReleaseSavepoint( "item" )

	transactionSetSavepoint( "item" )
	queryExecute( "UPDATE products SET price = ? WHERE id = ?", [ { value: 24.99, sqltype: "decimal", scale: 2 }, 42 ] )
	transactionReleaseSavepoint( "item" )
}
```

## Related

* [TransactionSetSavepoint](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/jdbc/transactionsetsavepoint.md)
* [TransactionRollback](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/jdbc/transactionrollback.md)
* [TransactionCommit](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/jdbc/transactioncommit.md)
* [Transaction component](https://boxlang.ortusbooks.com/boxlang-language/reference/components/jdbc/transaction.md)
* [Transaction guide](https://boxlang.ortusbooks.com/boxlang-framework/jdbc/transactions.md)
* [Transaction events](https://boxlang.ortusbooks.com/boxlang-framework/interceptors/core-interception-points/transaction-events.md#ontransactionreleasesavepoint)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/jdbc/transactionreleasesavepoint.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
