room/runtime/src/main/java/androidx/room/RoomDatabase.java
public <V> V runInTransaction(@NonNull Callable<V> body) {
        beginTransaction();
        try {
            V result = body.call();
            setTransactionSuccessful();
            return result;
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new RuntimeException("Exception in transaction", e);
        } finally {
            endTransaction();
        }
    }
/**
     * Executes the specified {@link Callable} in a database transaction. The transaction will be
     * marked as successful unless an exception is thrown in the {@link Callable}.
     *
     * @param body The piece of code to execute.
     * @param <V>  The type of the return value.
     * @return The value returned from the {@link Callable}.
     */
Executes the specified  Callable in a database transaction. The transaction will be
marked as successful unless an exception is thrown in the  Callable.

@param body The piece of code to execute.
@param   The type of the return value.
@return The value returned from the  Callable.
Executes the specified Callable in a database transaction . The transaction will be marked as successful unless an exception is thrown in the Callable . @param body The piece of code to execute . @param The type of the return value . @return The value returned from the Callable .
public <V> V runInTransaction(@NonNull Callable<V> body) {
        beginTransaction();
        try {
            V result = body.call();
            setTransactionSuccessful();
            return result;
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new RuntimeException("Exception in transaction", e);
        } finally {
            endTransaction();
        }
    }
public < V > V runInTransaction ( @ NonNull Callable < V > body ) { beginTransaction ( ) ; try { V result = body . call ( ) ; setTransactionSuccessful ( ) ; return result ; } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( "Exception in transaction" , e ) ; } finally { endTransaction ( ) ; } }
Executes the specified {@link Callable} in a database transaction.
Executes the specified { @link Callable } in a database transaction .