Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6064743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:18:49+00:00 2026-05-23T09:18:49+00:00

I have a webapp which calls openDatabase() on init. This works fine in desktop

  • 0

I have a webapp which calls openDatabase() on init. This works fine in desktop browsers Chrome and Safari; however, when I try to open the app in Mobile Safari on iOS 4.3.3, I get an exception on the first page load:

“Error: INVALID_STATE_ERROR: DOM Exception 11”

This fails on openDatabase() inside a simple function:

       try {
            if( !window.openDatabase) {
                console.log('SQLite is not supported by this browser');
            }
            else {
                db = openDatabase('MyMobileDb', '1.0', 'MyMobileDb', 65536);
                if (doreset)
                {
                    //my drop and reset DB function
                } else
                {
                    //my init DB function
                }
            }
        }
        catch(e) {
            console.log(e);
        }

The database is not created and no further interaction with the app is possible. Other developers running earlier versions of iOS are not experiencing this issue against the same code bade. I’m also getting reports from our QA team that Android presents similar behavior. Android 3.1 works, while 2.2 and 2.1 do not.

What can I do to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:18:49+00:00Added an answer on May 23, 2026 at 9:18 am

    I have some WebSQL code running in an off-line mobile app, which works in iOS 4.3.3 and desktop Safari OK.

    INVALID_STATE_ERROR: DOM Exception 11 is frustratingly opaque in that it can refer to so many different things, but I suspect the WebKit issue you link to has the answer in your case. Anyway, on to something that may help…

    FWIW in my code I initialise a database connection via a “kinda” factory, and this seems to work OK, persisting across my app (in fact, I use a database connection ‘factory’ plus a second prototyped object which encapsulates all my SQL, a bit like a Javascript DAO, but I’ll leave that bit out for the sake of brevity).

    I’ve created a gist with a sample ‘factory’ in it (it’s an extrapolation of some of my production code, so apologies for any omissions): http://gist.github.com/1044759

    This code will initialise your database connection, and create the relevant table(s) if they don’t already exist.

    Here’s some sample script (perhaps for $(document).ready) which will set up the db connection:

    // Initialise local db
    var mydb = new DbConnection().getDb();
    

    To use the connection, you simple call your normal transaction Javascript, using mydb as the database bit, i.e.:

    mydb.transaction(function(transaction){
      transaction.executeSql(...
    

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have an ASP.net web app which works fine for a few days, but then
Let's say I have an ASP.NET MVC webapp that calls a repository layer, which
I have a java webapp which needs to upload files via http and then
I had the following idea: Say we have a webapp written using django which
I have a Struts2 webapp, in which I compiled using the Tomcat 5.5 libraries.
I have Apache2 SSL which is fronting Spring webapp as follows: ProxyPass / http://localhost:8080/
I have MVC webApi application which works with Unity . I have to resolve
We have a PHP webapp that calls a Java binary to produce a PDF
I have a Webapp which connects to 2 DBs (one core, the other is
I have a more complex webapp in JSF2 (+EJB3.1 +JPA2 on glassfish 3.1), which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.