2

I'm using this very common line of code to create a HTML 5 local SQLite database:

var db = window.openDatabase("testDB","1.0","A test SQLite database",20000);

If the database already exists openDatabase should open it, however with each refresh of my page a new database with identical details to the existing one(s) is created. I am using Safari 5.1.2 to test this and viewing the storage via the error console -> Resources tab.

ThunderHorse
  • 365
  • 1
  • 4
  • 18
  • 3
    I've seen this as well in Safari, where the UI indicates multiple copies of the same DB and "creates" a new on on refresh. But if you exit Safari and come back to your site then there is only one. I chalked this up to a bug in Safari, as it doesnt happen in Chrome. That is, I dont think Safari is *really* creating multiple copies, just a UI bug. – Cody Caughlan Jan 19 '12 at 20:24
  • I had considered the possibility of the problem being a Safari bug as well but never noticed that the 'phantom' db's vanish on re-opening Safari. Thanks for the tip, I will pretend they don't exist and hope we are correct. – ThunderHorse Jan 19 '12 at 20:30

1 Answers1

2

This issue seems to be a UI related bug introduced in Safari 5.1.2 and does not appear to have any impact on my webapps performance.

Will edit if I can find conformation of this being a UI bug.

ThunderHorse
  • 365
  • 1
  • 4
  • 18