sqlite-sync / SQLite-sync.com

AMPLI-SYNC is a framework for synchronizing data between a Sqlite database and an MS SQL/MySQL/Oracle/PostgreSQL database. With this framework your application can work completely offline (Airplane Mode), then perform an automated Bidirectional Synchronization when an internet connection becomes available.
https://ampliapps.com/sqlite-sync/
BSD 3-Clause "New" or "Revised" License
328 stars 82 forks source link

Constraint Violation #3

Open hagabr opened 5 years ago

hagabr commented 5 years ago

ERROR PushInsertRecords() constraint violation PRIMARY KEY 'PK_XXX'. cannot insert the duplicated key in the object 'dbo.XXX'.

This make no sense because is not a new record. Its the same record the App sent to DB.

In the next syncronization get this message

tdziemidowicz commented 5 years ago

Is this happening on new records added from device?

hagabr commented 5 years ago

Yes, when trying send new records. And its works. New records is created.

But the violation is from DB to mobile.

tdziemidowicz commented 5 years ago

Make sure your synchronization process is in correct order:

  1. Send data
  2. Receive changes Those two steps need to be done in one run. If not changes will be send again with next synchronization. Did you do any modification in client?
hagabr commented 5 years ago

I build my mobile app on top your ionic sample code. Every interaction with sqlite-sync is made by your code.

balamuralii commented 5 years ago

How can we push data to server from mobile ?

is there any mechanism is preferred for large scale of applications.