{"action":"created","issue":{"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/644","repository_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage","labels_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/644/labels{/name}","comments_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/644/comments","events_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/644/events","html_url":"https://github.com/litehelpers/Cordova-sqlite-storage/issues/644","id":212962236,"number":644,"title":"SQLite transaction not working","user":{"login":"digaus","id":15358538,"avatar_url":"https://avatars3.githubusercontent.com/u/15358538?v=3","gravatar_id":"","url":"https://api.github.com/users/digaus","html_url":"https://github.com/digaus","followers_url":"https://api.github.com/users/digaus/followers","following_url":"https://api.github.com/users/digaus/following{/other_user}","gists_url":"https://api.github.com/users/digaus/gists{/gist_id}","starred_url":"https://api.github.com/users/digaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digaus/subscriptions","organizations_url":"https://api.github.com/users/digaus/orgs","repos_url":"https://api.github.com/users/digaus/repos","events_url":"https://api.github.com/users/digaus/events{/privacy}","received_events_url":"https://api.github.com/users/digaus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-09T08:03:41Z","updated_at":"2017-03-09T10:11:45Z","closed_at":null,"body":"Currently trying to use the SQLite plugin but cannot get a transaction to work... without the transaction filling the database works without any problems but when I wrap it in a transaction it does not work anymore.\r\n\r\nThe problem is that I do not get any error messages so I cannot really find the problem...\r\n\r\n```\r\n this.platform.ready().then(() =>{\r\n  \r\n      this.db.transaction((tx) => {\r\n        for(let i=0;i<data.length;i++){\r\n            let query = \"INSERT INTO test (name, description, url) VALUES (?,?,?)\";\r\n\r\n            //Reaching this point\r\n\r\n            tx.executeSql(query, [data[i].value1, data[i].value2, data[i].value3]).then(() => {\r\n              this.errHandler.showMsg('data added!'); //not called\r\n            }, (err) => {\r\n              this.errHandler.showMsg('Create Table Error!'); //not called\r\n            });\r\n        }\r\n      }, () => {\r\n          this.errHandler.showMsg('Transaction Success!'); //not called\r\n      }, (error) => {\r\n          this.errHandler.showMsg('Transaction Error!'+error.message); //not called\r\n      });\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/comments/285310503","html_url":"https://github.com/litehelpers/Cordova-sqlite-storage/issues/644#issuecomment-285310503","issue_url":"https://api.github.com/repos/litehelpers/Cordova-sqlite-storage/issues/644","id":285310503,"user":{"login":"digaus","id":15358538,"avatar_url":"https://avatars3.githubusercontent.com/u/15358538?v=3","gravatar_id":"","url":"https://api.github.com/users/digaus","html_url":"https://github.com/digaus","followers_url":"https://api.github.com/users/digaus/followers","following_url":"https://api.github.com/users/digaus/following{/other_user}","gists_url":"https://api.github.com/users/digaus/gists{/gist_id}","starred_url":"https://api.github.com/users/digaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digaus/subscriptions","organizations_url":"https://api.github.com/users/digaus/orgs","repos_url":"https://api.github.com/users/digaus/repos","events_url":"https://api.github.com/users/digaus/events{/privacy}","received_events_url":"https://api.github.com/users/digaus/received_events","type":"User","site_admin":false},"created_at":"2017-03-09T10:11:45Z","updated_at":"2017-03-09T10:11:45Z","body":"Got it sorted out! Ionic should really add some details in the documentation...\r\n\r\nthis.platform.ready().then(() =>{\r\n  \r\n      this.db.transaction((tx) => {\r\n        for(let i=0;i<data.length;i++){\r\n            let query = \"INSERT INTO test (name, description, url) VALUES (?,?,?)\";\r\n            tx.executeSql(query, [data[i].value1, data[i].value2, data[i].value3], (tx, resultSet) => {\r\n              this.errHandler.showMsg('data added!');\r\n            }, (err) => {\r\n              this.errHandler.showMsg('Create Table Error!'); \r\n            });\r\n        }\r\n      }, () => {\r\n          this.errHandler.showMsg('Transaction Success!');\r\n      }, (error) => {\r\n          this.errHandler.showMsg('Transaction Error!'+error.message);\r\n      });\r\n});"}}
{"actor":{"display_login":"digaus"}}