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

SqlBatch not executing success or error callbackes #7

Open
LucasBourgeois opened this issue Jun 23, 2023 · 0 comments
Open

SqlBatch not executing success or error callbackes #7

LucasBourgeois opened this issue Jun 23, 2023 · 0 comments

Comments

@LucasBourgeois
Copy link

LucasBourgeois commented Jun 23, 2023

Hi,

Im facing an issue really strange and i'm not able to find out what is the reason:

Im implementing the cordova-sqlite-storage like so:

  • I have multiple tables in a db, and populating my db tables one per one table with multiple INSERTS in a batch per table.
  • I attempt to do a db.sqlBatch() with multiple INSERTS in it like so: [['INSERT...', values], ['INSERT...', values]]
  • Then if the batch goes in error callback for a not existing table, i do a db.sqlExecution() of a CREATE TABLE IF NOT EXIST
  • Then, if the sqlExecution() is resolving, I do the first db.sqlBatch() that thrown.

Im trying to replace cordova-sqlite-storage plugin for this build because i need to be able to handle quite huge datasets.
EvCore, EvPlus can't handle the size of my data, so i'm trying this one.

But, here is the strange thing:
If i inject "CREATE TABLE" statement in my batch of multiple inserts, everything goes well.
If i stick to my first implementation, with multiple INSERTS in a batch and no table existing unless the error callback created it, im stuck as the db.sqlBatch() isnt executing either the success callback, nor the error one.
But, with this same implementation, if i have only one insert in my batch, then, everything is ok and resolve with success.

Create tables statements are not always in my batch to ensure (maybe for useless concerns) better performances and our usage of sqlite db, once it's created, it will be there whatever happens.

Did someone ever faced an issue like this ?

My env: Ionic V1, angularJs, Android 13, and cordova sqlite evmax build

Thanks,

Lucas

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

1 participant