{"id":783,"date":"2012-01-13T18:56:47","date_gmt":"2012-01-13T09:56:47","guid":{"rendered":"http:\/\/adreamer.godohosting.com\/?p=783"},"modified":"2012-01-13T18:56:47","modified_gmt":"2012-01-13T09:56:47","slug":"db-error-while-creating-cookiesyncmanager","status":"publish","type":"post","link":"http:\/\/milkdrops.net\/index.php\/archives\/783","title":{"rendered":"DB error while creating CookieSyncManager"},"content":{"rendered":"<p>If the app has services, or other processes, then you can see this kind of error when using CookieSyncManager.<\/p>\n<p><code>01-13 16:44:46.674: E\/Database(4298): CREATE TABLE android_metadata failed<br \/>\n01-13 16:44:46.690: E\/Database(4298): Failed to setLocale() when constructing, closing the database<br \/>\n01-13 16:44:46.690: E\/Database(4298): android.database.sqlite.SQLiteException: database is locked<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:2113)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1966)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:887)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:965)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:958)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:576)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.webkit.WebViewDatabase.getInstance(WebViewDatabase.java:214)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.webkit.WebSyncManager.(WebSyncManager.java:65)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.webkit.CookieSyncManager.(CookieSyncManager.java:69)<br \/>\n01-13 16:44:46.690: E\/Database(4298): at android.webkit.CookieSyncManager.createInstance(CookieSyncManager.java:96)<\/code><\/p>\n<p>This happens because the DB created inside the CookieSyncManager is accessible from only one process.<br \/>\nI couldn&#8217;t find the way to use the CookieSyncManager from more than one process.<\/p>\n<p>Also, I tried to CookieSyncManager.createInstance() from one process and CookieSyncManager.getInstance() from another, but it didn&#8217;t work.<\/p>\n<p>I should have to solve this problem by only using the CookieSyncManager from one process.<br \/>\nAlso keep in mind that CookieManager requires CookieSyncManager to work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If the app has services, or other processes, then you can see this kind of error when using CookieSyncManager. 01-13 16:44:46.674: E\/Database(4298): CREATE TABLE android_metadata failed 01-13 16:44:46.690: E\/Database(4298): Failed to setLocale() when constructing, closing the database 01-13 16:44:46.690: E\/Database(4298): android.database.sqlite.SQLiteException: database is locked 01-13 16:44:46.690: E\/Database(4298): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method) 01-13 16:44:46.690: E\/Database(4298): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:2113) &hellip; <a href=\"http:\/\/milkdrops.net\/index.php\/archives\/783\" class=\"more-link\"><span class=\"screen-reader-text\">DB error while creating CookieSyncManager<\/span> \ub354\ubcf4\uae30 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[117,116],"tags":[77,118,113,115],"class_list":["post-783","post","type-post","status-publish","format-standard","hentry","category-android-english","category-english","tag-android","tag-cookiemanager","tag-cookiesyncmanager","tag-multiprocess"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/milkdrops.net\/index.php\/wp-json\/wp\/v2\/posts\/783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/milkdrops.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/milkdrops.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/milkdrops.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/milkdrops.net\/index.php\/wp-json\/wp\/v2\/comments?post=783"}],"version-history":[{"count":1,"href":"http:\/\/milkdrops.net\/index.php\/wp-json\/wp\/v2\/posts\/783\/revisions"}],"predecessor-version":[{"id":784,"href":"http:\/\/milkdrops.net\/index.php\/wp-json\/wp\/v2\/posts\/783\/revisions\/784"}],"wp:attachment":[{"href":"http:\/\/milkdrops.net\/index.php\/wp-json\/wp\/v2\/media?parent=783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/milkdrops.net\/index.php\/wp-json\/wp\/v2\/categories?post=783"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/milkdrops.net\/index.php\/wp-json\/wp\/v2\/tags?post=783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}