title: Room database transaction rollback
body: <p>With Room Database, I'm executing multiple <code>DELETE</code> + <code>INSERT</code> queries from different <code>DAO's</code>.</p>
  
  <p>I'm using transactions as:</p>
  
  <pre><code>myDb.runInTransaction(new Runnable() {
       @Override
       public void run() {
       }
  });
  </code></pre>
  
  <p>Is there a way to <code>ROLLBACK</code> in case anything fails?</p>
  
  <p><strong>Later edit:</strong>
  Using this pattern seems to work:</p>
  
  <pre><code>myDb.beginTransaction();
  if(success){
   myDb.setTransactionSuccessful(); -&gt; commit
  }
  myDb.endTransaction();
  </code></pre>