title: Android: SQLite transactions when using ContentResolver
body: <p>The goal: refresh database from XML data</p>
  
  <p>The process:</p>
  
  <ul>
  <li><strong>Start transaction</strong></li>
  <li><strong>Delete</strong> all existing rows from the tables</li>
  <li>Per each main element of parsed XML <strong>insert</strong> row into main table and get PK</li>
  <li>Per each child of the main element <strong>insert</strong> record into 2nd table providing FK from the previous step</li>
  <li><strong>Commit transaction</strong></li>
  </ul>
  
  <p>Pretty standard stuff as far as db operations. The problem is that CRUD operations are not done within <code>ContentProvider</code> but rather using <code>ContentResolver</code> so the insert for example looks like <code>resolver.insert(CONTENT_URI, contentValues)</code>. The ContentResolver API doesn't seem to have anything pertained to transaction and I cannot use <code>bulkInsert</code> since I'm inserting in 2 tables intermittently (plus I want to have <code>delete</code> inside the transaction as well). </p>
  
  <p>I was thinking of registering my customized <code>ContentProvider</code> as listener by using <code>registerContentObserver</code> but since <code>ContentResolver#acquireProvider</code> methods are hidden how do I obtain the right reference?</p>
  
  <p>Am I out of luck?</p>