SPI\_rollback

|       SPI\_rollback       |                          |                            |                  |                                       |
|:-------------------------:|--------------------------|----------------------------|------------------|---------------------------------------|
|[Prev](spi-spi-commit.html)|[Up](spi-transaction.html)|47.4. Transaction Management|[Home](index.html)| [Next](spi-spi-start-transaction.html)|

---

[]()[]()

## SPI\_rollback

SPI\_rollback, SPI\_rollback\_and\_chain — abort the current transaction

## Synopsis

```
void SPI_rollback(void)

```

```
void SPI_rollback_and_chain(void)

```

## Description

`SPI_rollback` rolls back the current transaction. It is approximately equivalent to running the SQL command `ROLLBACK`. After a transaction is rolled back, a new transaction has to be started using `SPI_start_transaction` before further database actions can be executed.

`SPI_rollback_and_chain` is the same, but a new transaction is immediately started with the same transaction characteristics as the just finished one, like with the SQL command `ROLLBACK AND CHAIN`.

 These functions can only be executed if the SPI connection has been set as nonatomic in the call to `SPI_connect_ext`.

---

|[Prev](spi-spi-commit.html)|[Up](spi-transaction.html)| [Next](spi-spi-start-transaction.html)|
|:--------------------------|:------------------------:|--------------------------------------:|
|        SPI\_commit        |    [Home](index.html)    |        SPI\_start\_transaction        |

 // \<![CDATA[ \<-- For SVG support if ('WebSocket' in window) { (function() { function refreshCSS() { var sheets = [].slice.call(document.getElementsByTagName("link")); var head = document.getElementsByTagName("head")[0]; for (var i = 0; i \< sheets.length; ++i) { var elem = sheets[i]; head.removeChild(elem); var rel = elem.rel; if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") { var url = elem.href.replace(/(&|\\?)\_cacheOverride=\\d+/, ''); elem.href = url + (url.indexOf('?') \>= 0 ? '&' : '?') + '\_cacheOverride=' + (new Date().valueOf()); } head.appendChild(elem); } } var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://'; var address = protocol + window.location.host + window.location.pathname + '/ws'; var socket = new WebSocket(address); socket.onmessage = function(msg) { if (msg.data == 'reload') window.location.reload(); else if (msg.data == 'refreshcss') refreshCSS(); }; console.log('Live reload enabled.'); })(); } // ]]\>