Tried out your sample. Certainly shows the problem well. After more playing, I know more about the problem than I think I'd like :P.
It's not that you can't open multiple databases, it's that you can create only one database. What I mean is, if you ever restart the app and use a different name for the database, it will fail as well. The only way I could get it to work was to use sqlite3 on the native side to pre-create a second database. If you do that, then you can open multiple at a time. I did it by changing the db path to /sdcard/dbs and using adb to move the files back and forth to my computer. So... I don't think I'm going to invest any more time into this. I just added caveats to the websql README about not being able to open multiple databases. If you really can't live without this feature, you might try writing a plugin that pre-creates a database for you so that you can later open it with openDatabase() On Thu, Oct 10, 2013 at 5:02 AM, Dick Van den Brink < [email protected]> wrote: > Not sure what the namespace issue is, but I created a quick example > project. > It might not be the best code but that doesn't really matter. :-)Code is > on: https://github.com/DickvdBrink/cordova-websql/ > after the checkout you might need to run "android update project --path > platforms/android"It always opens one db, with the name "firstDb" in the > deviceready event.When you click the the text: "Click here to load db with > name "secondDb" I get a security error in the javascript alert box.If you > don't get the error it changes the text to "Second db loaded". > > Date: Wed, 9 Oct 2013 08:44:08 -0700 > > Subject: Re: So, what to do about storage issues? > > From: [email protected] > > To: [email protected] > > > > I think this is the namespace issue. We need to make sure the plugin > > always overrides the default namespace. > > On Oct 9, 2013 8:00 AM, "Andrew Grieve" <[email protected]> wrote: > > > > > Example project would be great! > > > > > > > > > On Wed, Oct 9, 2013 at 10:27 AM, Dick Van den Brink < > > > [email protected]> wrote: > > > > > > > I don't think it is fixed with the org.apache.cordova.websql plugin.I > > > > still can open only one database. The second one is giving me a > security > > > > error on Android 4.1.2. > > > > I'm on Cordova 3.0 btw. I added some logging to the websql plugin > code to > > > > make sure it was using it and that seems to be the case. I can > create an > > > > example project if you want. > > > > > > > > > From: [email protected] > > > > > Date: Wed, 9 Oct 2013 10:04:14 -0400 > > > > > Subject: Re: So, what to do about storage issues? > > > > > To: [email protected] > > > > > > > > > > I think let's document the quirks (CB-4760), and close the other > two as > > > > > fixed (via org.apache.cordova.websql plugin) > > > > > > > > > > > > > > > On Tue, Oct 8, 2013 at 5:55 PM, Shazron <[email protected]> wrote: > > > > > > > > > > > Not sure you guys got Ray's message below if you were on Gmail -- > > > > since it > > > > > > filtered it out as spam (confirmed with another committer/Gmail > user) > > > > :/ > > > > > > > > > > > > > > > > > > On Tue, Oct 8, 2013 at 2:30 PM, Ray Camden <[email protected]> > > > wrote: > > > > > > > > > > > > > Hmm, from CB-4760: > > > > > > > > > > > > > > "The problem is that the Storage Guide documentation > > > > > > > ( > > > > > > > > > > > > > > > > > > > > > http://cordova.apache.org/docs/en/3.0.0/cordova_storage_storage.md.html#St > > > > > > > orage) currently doesn't mention any Android Quirks at all, so > as > > > > far as > > > > > > > user knows it should all work OK as per the API guide." > > > > > > > > > > > > > > Yeah - this is what worries me the most. Couldn't the docs be > > > updated > > > > > > > pretty quickly to let folks know about issues? > > > > > > > > > > > > > > > > > > > > > On 10/8/13 4:05 PM, "Joe Bowser" <[email protected]> wrote: > > > > > > > > > > > > > > >What should we do for Storage Plugin issues on Android? > Should we > > > > just > > > > > > > >close them as "Won't Fix" and tell people to use the > cordova-labs > > > > > > > >plugins? Currently, we don't have a plugin repo for the > storage > > > > > > > >plugin, and it's been ripped out in 3.x. > > > > > > > > > > > > > > > >What should we do with these issues?? > > > > > > > >https://issues.apache.org/jira/browse/CB-4506 > > > > > > > >https://issues.apache.org/jira/browse/CB-4505 > > > > > > > >https://issues.apache.org/jira/browse/CB-4760 > > > > > > > > > > > > > > > >Thoughts? > > > > > > > > > > > > > > > >Joe > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
