title: database is locked (code 5): , while compiling: PRAGMA journal_mode MULTIPLE DATABASES
body: <p>I am creating a SDK that is implemented by client app, the client app has it's own DB. I create and access my DB using the client app's <code>application context</code>.</p>
  
  <p>I have used a <code>Singleton Pattern</code> for my <code>SQLOpenHelper</code> and made sure access to it is through a <code>synchronised</code> method.</p>
  
  <p>The client app still gets</p>
  
  <pre><code>database is locked (code 5): , while compiling: PRAGMA journal_mode
     at android.database.sqlite.SQLiteConnection.nativePrepareStatement(SQLiteConnection.java)
     at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:896)
     at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:641)
     at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:323)
     at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:297)
     at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:218)
     at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:196)
     at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
     at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
     at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
     at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:836)
     at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:821)
     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:714)
     at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:592)
     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:280)
     at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223)
     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
  </code></pre>
  
  <ol>
  <li><p>Can someone please tell me why this crash could be happening?</p></li>
  <li><p>Can it be because of simultaneous access to the Client DB as well as my DB?</p></li>
  <li><p>Does a common SQLiteOpenHelper instance is provided for client as well as my app?</p></li>
  </ol>
  
  <p>Thanks for help in advance!!!</p>