title: Lawnchair storage with 2 collections on Phonegap Android
body: <p>I ran into a nasty problem with Lawnchair (0.6.1). I want to have 2 globally accessible collections/Lawnchairs, both with the <em>webkit-sqlite</em> adapter. This is how I declare them, right after loading Lawnchair and the adapter:</p>
  
  <pre><code>var clientStore = Lawnchair({name: 'clients'}, function () {});
  var companyStore = Lawnchair({name: 'companies'}, function () {});
  // other global variables
  ...
  </code></pre>
  
  <p>In Safari and Chrome on my desktop everything is smooth sailing, same for my iPad and other iOS devices in the emulator using Phonegap (3.0.0). No problems at all, <strong>both</strong> databases show up in the web inspector and in Weinre. I can use them in any of JQuery Mobile events (version 1.3.2 and 1.4.0 beta). Manually checking the database objects in Weinre confirms that they are indeed using the <em>webkit-sqlite</em> adapter.</p>
  
  <p>But if run the Phonegap app on Android, only the <code>clientStore</code> is accessible and usable. Trying to access the <code>companyStore</code> gives me the following error:</p>
  
  <pre><code>companyStore.all(function (allEntries) {
      console.log(allEntries);
  ...
  </code></pre>
  
  <p><code>&gt; TypeError: Cannot call method 'all' of undefined</code></p>
  
  <p>The only database that shows up in Weinre on the Android device is the <code>clients</code> database. Manually initializing the <code>companies</code> database from the Weinre inspector console after everything loaded up doesn't show any effect on the list of databases on the 'Resources' tab or change anything else (except for the above error visually disappearing).</p>
  
  <p>Trying to access the 'undefined' <code>companyStore</code> programmatically, say when someone switches to a page where all the companies shall be listed, 'crashes' the UI on the Android device. Nothing even gets printed on the console anymore after that. As said, all other platforms work just fine.</p>
  
  <p>Am I just doing something stupidly wrong or did I encounter a bug/feature?</p>
  
  <p>Thanks a ton for the help, this one is driving me up the wall :(.</p>
  
  <p><strong>Edit:</strong> using the standard DOM adapter works for me on every platform so far. I guess I'll stick to that one for now. In case someone ran into the same problem, here's how to explicitly use the DOM adapter:</p>
  
  <pre><code>var clientStore = Lawnchair({name: 'clients', adapter: 'dom'}, function () {});
  var companyStore = Lawnchair({name: 'companies', adapter: 'dom'}, function () {});
  </code></pre>