jacques
jacques

Reputation: 240

IBM Worklight 6.0 - How to use JSONStore's sync ability with a SQL adapter

I'm following the document: 05_10_JSONStore_-_Synchronizing_client_and_server_databases.pdf

My adapter retrieves data from an SQL table.
It isn't clear if I need to call the WL.Client.invokeProcedure() and where the success/failure callbacks are.

Upvotes: 1

Views: 1440

Answers (1)

cnandreu
cnandreu

Reputation: 5111

I recommend reading the latest Getting Started Modules for JSONStore here. Specifically:

it isn't clear if i need to call or where the WL.Client.invokeProcedure() and the success/failure callback.

Going back to your question. You can manually call getPushRequired and then invokeProcedure to send changes to the adapter or you can use push and calling the adapter will be done for you. Similarly, you can call load to get data from the adapter, or manually call invokeProcedure and then add to put changes into JSONStore. If you manually call the add method, there's a flag {push: false} that will tell JSONStore not to mark the document as "needs to be pushed to the server". If you intend to use the load or push method, you must link the adapter to a collection when you call the init method.

Upvotes: 3

Related Questions