Android onUpgrade Database causing IllegalStateException
<p>in my <code>dbHelper</code>:</p>

<pre><code>onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) 
</code></pre>

<p>function I save one table to an external database.</p>

<p>Therefore I </p>

<ol>
<li>attach and copy to the external database</li>
<li>delete the db file in this function and copy it from external</li>
<li>restore from external database to db.</li>
</ol>

<p>this works until the function returns to getWritableDatabase()</p>

<p>Here I get this exception:</p>

<pre><code>java.lang.IllegalStateException: no transaction pending
</code></pre>

<p>What is wrong? Thanks
Tata</p>
