You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shingo Toda (JIRA)" <ji...@apache.org> on 2013/08/21 03:02:34 UTC

[jira] [Updated] (CB-4505) Database#changeVersion() method is not implemented in Storage plugin

     [ https://issues.apache.org/jira/browse/CB-4505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shingo Toda updated CB-4505:
----------------------------

    Description: 
I'm using Cordova 2.9.0.

In my understanding, when window.openDatabase() is called, if SECURITY_ERR is returned then Storage plugin is used, otherwise browser's WebSQL is used.

When Storage plugin is used, changeVersion() method cannot be used because the method is actually not implemented.

I got this issues with my mobile phone (ICS) but you can reproduce this in any environment by modifying the following line in cordova.js to forcedly use Storage plugin (Note that unrelated lines are deleted). 


{code: title=lib/android/plugin/android/storage/openDatabase.js}
define("cordova/plugin/android/storage/openDatabase", function(require, exports, module) {


module.exports = function(name, version, desc, size) {

    try {
        return storage.openDatabase(name, version, desc, size);  <--- ADD!!

        return originalOpenDatabase(name, version, desc, size);
    } catch (ex) {
        if (ex.code !== 18) {
            throw ex;
        }
    }
    return storage.openDatabase(name, version, desc, size);
};

});
{code}


  was:
I'm using Cordova 2.9.0.

In my understanding, when window.openDatabase() is called, if SECURITY_ERR is returned then Storage plugin is used, otherwise browser's WebSQL is used.

When Storage plugin is used, changeVersion() method cannot be used because the method is actually not implemented.

I got this issues with my mobile phone (ICS) but you can reproduce this in any environment by modifying the following line in cordova.js to forcedly use Storage plugin (Note that unrelated lines are deleted). 


~~~
// file: lib/android/plugin/android/storage/openDatabase.js
define("cordova/plugin/android/storage/openDatabase", function(require, exports, module) {


module.exports = function(name, version, desc, size) {

    try {
        return storage.openDatabase(name, version, desc, size);  <--- ADD!!

        return originalOpenDatabase(name, version, desc, size);
    } catch (ex) {
        if (ex.code !== 18) {
            throw ex;
        }
    }
    return storage.openDatabase(name, version, desc, size);
};

});
~~~


    
> Database#changeVersion() method is not implemented in Storage plugin
> --------------------------------------------------------------------
>
>                 Key: CB-4505
>                 URL: https://issues.apache.org/jira/browse/CB-4505
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, CordovaJS
>    Affects Versions: 2.9.0
>         Environment: Android 2.3.x, 3.x, 4.x on emulator
> Android 4.x on physical device
>            Reporter: Shingo Toda
>            Assignee: Joe Bowser
>            Priority: Minor
>
> I'm using Cordova 2.9.0.
> In my understanding, when window.openDatabase() is called, if SECURITY_ERR is returned then Storage plugin is used, otherwise browser's WebSQL is used.
> When Storage plugin is used, changeVersion() method cannot be used because the method is actually not implemented.
> I got this issues with my mobile phone (ICS) but you can reproduce this in any environment by modifying the following line in cordova.js to forcedly use Storage plugin (Note that unrelated lines are deleted). 
> {code: title=lib/android/plugin/android/storage/openDatabase.js}
> define("cordova/plugin/android/storage/openDatabase", function(require, exports, module) {
> module.exports = function(name, version, desc, size) {
>     try {
>         return storage.openDatabase(name, version, desc, size);  <--- ADD!!
>         return originalOpenDatabase(name, version, desc, size);
>     } catch (ex) {
>         if (ex.code !== 18) {
>             throw ex;
>         }
>     }
>     return storage.openDatabase(name, version, desc, size);
> };
> });
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira