Open mareksip opened 9 years ago
Hi @mareksip,
Here are the possible reasons of this issue:
onSuccess
and onError
are defined (can't see them in your code),SQLite.Proxy
in the references,@daserge thank you for taking your time to investigate this issue.
@mareksip can you please add window.__webSqlDebugModeOn = true;
before this line?
db = window.openDatabase("lilka", "1.0", "Lilka hybrid db", dbSize);
Probably some error details will arise.
@daserge added the line as suggested but no detailed exception arised.
From Output tab:
Exception was thrown at line 105, column 9 in ms-appx://io.cordova.myapp8724a31325644ec29a8d2d88682b7987/www/plugins/com.msopentech.websql/www/windows/SqlTransaction.js
0x800a139e - JavaScript – runtime error: [object Object]
Unhandled exception at line 105, column 9 in ms-appx://io.cordova.myapp8724a31325644ec29a8d2d88682b7987/www/plugins/com.msopentech.websql/www/windows/SqlTransaction.js
0x800a139e - JavaScript – runtime error: [object Object]
I have found out that it fails while executing the CREATE TABLE IF NOT EXISTS.
I am confused why it does work with Android emulator, any idea? - Because the plugin only covers Windows platform. Cordova has its own implementation of SQLite to iOS and Android.
@mareksip can you please take a look into JavaScript console? In Visual Studio it is in Debug -> Wndows -> JavaScript console
PS: I think it works in Android and iOS as WebSql is supported natively in Chrome and Safari.
@daserge sorry, here is the output from JavaScript Console:
File: index.html
adding proxy for WebSql
openDatabase: name = lilka
[Database] name: lilka, lastTransactionId: 0. | new Database(); name = lilka
[Database] name: lilka, lastTransactionId: 0. | transaction
[SqlTransaction] id: 1, connectionId: 1. | Error occured while executing sql: SAVEPOINT trx1. Error: [object Object]
[Database] name: lilka, lastTransactionId: 1. | transaction.run callback error, lastTransactionId = 1; error: [object Object]
[SqlTransaction] id: 1, connectionId: 1. | Error occured while executing sql: ROLLBACK TO trx1. Error:[object Object]
SCRIPT5022: Unhandled exception at line 105, column 9 in ms-appx://io.cordova.myapp8724a31325644ec29a8d2d88682b7987/www/plugins/com.msopentech.websql/www/windows/SqlTransaction.js 0x800a139e - JavaScript – runtime error : [object Object]
File: SqlTransaction.js, Line: 105, Column: 9
I have found out that the exception is thrown on the line for CREATE TABLE
@mareksip could you please also set a breakpoint on /www/plugins/com.msopentech.websql/www/windows/SqlTransaction.js Line 105 and copy the error details?
@daserge Code 14: unable to open database file
@mareksip thanks for the details! I will investigate this issue later.
One more question regarding your setup - can you please check if the sample app works for you? Here are the steps to test it:
git clone https://github.com/MSOpenTech/cordova-plugin-websql
cordova create sample --copy-from="cordova-plugin-websql\test"
cd sample
cordova platform add windows
cordova plugin add ..\cordova-plugin-websql
cordova run windows
Or in one command:
git clone https://github.com/MSOpenTech/cordova-plugin-websql && cordova create sample --copy-from="cordova-plugin-websql\test" && cd sample && cordova platform add windows && cordova plugin add ..\cordova-plugin-websql && cordova run windows
Additionally can you please send the entire solution if possible?
@daserge the test sample works well. I have tested all possible functions. I will try to follow the sample for now to find out if there are any differences in my code. Please note that I have installed version 0.5 as it is suggested by default in plugins of Visual Studio. Thank you.
Hi @daserge, have you had a spare time to look into this issue, please? I would be really glad to use this plugin in my app.
Hi @mareksip, I would take a look if I could reproduce the issue - can you please upload the project code somewhere so that I can investigate?
I am debugging Apache Cordova application in Visual Studio 2013.4. The application works fine in Ripple and Android emulator, however, when I try to debug on Windows x64 or Windows Phone (device) I get following error:
On this line: https://github.com/MSOpenTech/cordova-plugin-websql/blob/17015eb938d902eeb6018c03e438658103b28c17/www/windows/SqlTransaction.js#L105
Here is my code inside index.html in onDeviceReady function:
I have found out that it fails while executing the CREATE TABLE IF NOT EXISTS.