Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databasePath is lost when first executing the app #3

Open
gabrielmuresan opened this issue Feb 17, 2014 · 3 comments
Open

databasePath is lost when first executing the app #3

gabrielmuresan opened this issue Feb 17, 2014 · 3 comments

Comments

@gabrielmuresan
Copy link

This happens when first lunching the application, I checked and from the javascript file everything goes fine, there is a database path name set, I checked every use of "this.dbPath" and "dbPath" in the SqlitePlugin.js for every call to cdv.exec() and more, but I still get the error like ~95% of the time.

To get past it I just stop and relaunch the application for as many times as needed until I get the message "DB opened: tnam000178" but NOT after the exception is thrown (yeah, sometimes it happens to open the database after the exception is thrown and execution stops)

By removing the piece of code that was throwing the error I decrease the error rate from ~95% to ~85% (the console doesn't show any error, but the code does not continue as expected)
but that may be only a coincidence since I am not going to test that theory hundreds of times

this happens to the following emulators:

  1. windows phone 8 WVGA 512mb
  2. windows phone 8 Update 3 WVGA 512mb
  3. windows phone 8.0.10322 WVGA 512mb

Actually, while writing this issue I made some tests,

  1. the first try with no changes to the code 0 times success;
  2. the second try with changes to the code by commenting out the throw part 0 times success;
  3. the third try with changes to the code by replacing the throw error to rename the databasePath to my actual database name 1/~8 times success
SQLitePlugin.open with options:["tnam000178","SQLitePlugin1559774024"]
SQLitePlugin.open():tnam000178
A first chance exception of type 'System.ArgumentException' occurred in com.example.ATest.DLL
Error: System.ArgumentException: Must be specified
Parameter name: databasePath
   at SQLite.SQLiteConnection..ctor(String databasePath, SQLiteOpenFlags openFlags, Boolean storeDateTimeAsTicks)
   at SQLite.SQLiteConnection..ctor(String databasePath, Boolean storeDateTimeAsTicks)
   at Cordova.Extension.Commands.SQLitePlugin.executeSqlBatch(String options)
@pille72
Copy link

pille72 commented Mar 25, 2014

have you solved this problem?

@antranapp
Copy link

You should only execute the sql in the success callack of the openDatabase function. I have no error anymore after doing that.

Or use this fork, it seems that the issue is fixed: nadyaA@5af6842

@gabrielmuresan
Copy link
Author

the error seems to be solved after upgrading my machine to better support the windows phone emulator. it only appears once in a while so I suspect is something wrong in the code I use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants