1
votes

I am looking for best-practices for providing bi-directional sql replication under the codenameone framework.

The applications will install with a bare database and connect to a REST server to pull down current data templates (xml files stored in sql varchar). the mobile application will create local database tables from the templates, and create dynamic forms from the template as well. This allows the mobile application to run completely disconnected from the net.

When a connection is available, any new or modified records will be posted to the REST server to update the central master database for that user. At the same time, any new or modified records will be downloaded.

I know I will need to provide my own replication services as SQLite does not provide them, especially in mobile versions.

Is there already a framework in codenameone for this behavior or are there examples which would simplify building the framework?

1

1 Answers

0
votes

There are no best practices on this at this time and no pre-existing tools although this seems like a good candidate for automation. There is the data access library but I don't have any experience working with it to give you a sense if it simplifies the process.

Notice that sqlite isn't very portable, so if you will rely on relational integrity and other behaviors they might work very differently between iOS & Android.

Also notice that the iOS version of sqlite isn't threadsafe so extra caution needs to take place when working with that database.