Database closes automatically

122 views
Skip to first unread message

Raj Govender

unread,
Oct 30, 2015, 5:38:13 AM10/30/15
to PouchDB
Hi,

Please help. After upgrading to iOS 9.1 Safari is closing PouchDB database automatically after a few minutes. Refresh of the web page fixes this but you loose data from current screen. We noticed it closes it after switching off the iPad or iPhone while the app the running. We see the following error in the console,

r {message: "database has been closed", name: "Object", status: 500, error: true, toString: function}


Thanks in advance. 


Raj

Nolan Lawson

unread,
Nov 5, 2015, 5:28:40 PM11/5/15
to PouchDB
Can you provide more details? Is this in Safari, Chrome for iOS, UIWebView, or WKWebView? Also are you using the WebSQL adapter, the SQLite Plugin, or something else?

Also this discussion may be more appropriate for a Github issue.

Cheers,
Nolan

Ricardo Carraretto

unread,
Nov 11, 2015, 3:44:56 PM11/11/15
to PouchDB
I'm not sure it is the same issue, but I get different behavior on the same devices when running as a HomeScreen App, or just from Chrome. Everything runs fine on Chrome, but I get the following errors when running as a HomeScreen App:

[Warning] PouchDB: the remote database may not have CORS enabled.If not please enable CORS: http://pouchdb.com/errors.html#no_access_control_allow_origin_header (pouchdb-5.1.0.min.js, line 9)

[Warning] PouchDB: the remote database may not have CORS enabled.If not please enable CORS: http://pouchdb.com/errors.html#no_access_control_allow_origin_header (pouchdb-5.1.0.min.js, line 9)

[Error] Failed to load resource: fluxo de pedidos esgotado (_bulk_get, line 0)

 [Log] r {status: 500, name: "unknown_error", message: "Database encountered an unknown error", error: true, line: 0, …} (myApp, line 849)


It seems that the CORS detection algorithm is not very precise, as CORS is indeed enabled.

This is an iPAD mini running iOS 8.4.1, and the remote DB is hosted on Cloudant. I also see the same behavior on an iPad 2 running iOS 9.1. My bet here is that something is not right in the way Safari is handling either the IndexedDB or WebSQL.

Kind regards
Ricardo Carraretto
Reply all
Reply to author
Forward
0 new messages