# Interface Datastore.TransactionCallable&lt;T&gt; (3.1.0)

3.1.0 (latest) 2.40.0 2.37.0 2.36.0 2.34.0 2.33.3 2.32.3 2.31.4 2.30.0 2.29.1 2.28.2 2.27.1 2.26.4 2.25.2 2.24.3 2.23.0 2.22.0 2.21.3 2.20.2 2.19.2 2.18.5 2.17.6

    public static interface Datastore.TransactionCallable<T>

A callback for running with a transactional [com.google.cloud.datastore.DatastoreReaderWriter](https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.DatastoreReaderWriter). The associated transaction will be committed
after a successful return from the `run` method. Any propagated exception will cause the
transaction to be rolled-back.

| ## Type Parameter ||
|---|---|
| **Name** | **Description** |
| `T` |   |

## Methods

### run(DatastoreReaderWriter readerWriter)

    public abstract T run(DatastoreReaderWriter readerWriter)

Callback's invoke method for the TransactionCallable.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `readerWriter` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.DatastoreReaderWriter` DatastoreReaderWriter associated with the new transaction |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `T` | T The transaction result |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html` | upon failure |