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

Transaction Support in JsStore #44

Closed
erraisahmad opened this issue May 8, 2018 · 12 comments
Closed

Transaction Support in JsStore #44

erraisahmad opened this issue May 8, 2018 · 12 comments
Assignees

Comments

@erraisahmad
Copy link

Hi,

I am working on a web app which stores some offline data in IndexedDB.
I am integrating this library into my project. I have a requirement of performing multiple operations tables in a single transaction, so that the operations can be rolled back, if any error occurs in any operation.
Indexed Db supports transaction as follows

var transaction = db.transaction();   //API for representation only
 var store = transaction.objectStore();  // //API for representation only 
 request = store.add();     //API for representation only

Does JsStore support transactions where I can perform multiple CRUD operations?
Can you please let me know if I can achieve similar functionality using JsStore?

@ujjwalguptaofficial
Copy link
Owner

Hi
Currently jsstore does not support transaction but I am already working on this. Though its great that you found out

@ujjwalguptaofficial
Copy link
Owner

Hi - I have added transaction. Here is the doc - http://jsstore.net/tutorial/transaction/ .

Let me know if you have any problem.

@erraisahmad
Copy link
Author

erraisahmad commented Jul 1, 2018 via email

@theS3ns
Copy link

theS3ns commented Jul 2, 2018

Hello,

I would like to know if it is possible to check if a transaction is in progress? The following example, I use JSStore in Angular 5 as cache and if the component was destroyed, a write process should be executed. At the same time, a component is initialized to this data record in read mode. Because of the fact that asynchronous execution occurs, this leads to the error.

Greetings

@ujjwalguptaofficial
Copy link
Owner

Hi

I am not able to understand the situation. Can you explain more ?

also what do you mean when you say - to check if a transaction is in progress ? I mean you call the transaction api and then transaction is started.

Let me know what do you think?

@theS3ns
Copy link

theS3ns commented Jul 3, 2018

Hi,

thanks for your response. Is there a possibility to see get the state of a process. e.g. like transaction, insert, delete, update?

I need this for Angular 5 Livecircle. First Component is in ngOnDestroy and update table. Second Component is in ngOnInit and read in the same table older data because the update table is not finished.

@ujjwalguptaofficial
Copy link
Owner

so you want to know what query is currently being executed right ?

@theS3ns
Copy link

theS3ns commented Jul 3, 2018

Correct or whether one is executed at all

@ujjwalguptaofficial
Copy link
Owner

yes you can get that. connection object holds the list of request that will be executed so the request which is being executed is - the first value in the array.

image

Hope this helps. Let me know.

@ujjwalguptaofficial
Copy link
Owner

And also please fire other issue , we should not pollute this issue page. Thanks.

@theS3ns
Copy link

theS3ns commented Jul 3, 2018

Okay, excuse me. My question was answered with the picture.

@ujjwalguptaofficial
Copy link
Owner

@erraisahmad - how is transaction working for you. Let me know , otherwise please close the issue.

Thanks

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

No branches or pull requests

3 participants