Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread Using EDB "Update" (Replication) features, and experiencing a problem.
Tue, Sep 3 2024 10:37 AMPermanent Link

Adam Brett

Orixa Systems

I would be really grateful for assistance with any EDB-folks who have experience with replication.

I have an App where users use and update a database which is then UPDATED to a central server.

The central server holds the master copy, and distributed users add data. There are some foreign-key constraints in the data, but all users are just adding their own data, and there is no risk of one user deleting the foreign key of another.

The work-flow is:
* Add details of a new person.
* Add some child records for this person
* Repeat.

Sometimes a user might delete data (for example after a double entry) but if they try to delete a Person that has child records the existence of the foreign key will block this, and the user has to delete the child records first.

--

So: I have an update file which is not applying to the central server.

I am calling this SQL:

LOAD UPDATES FOR Database "Data"
FROM "1013000004-Upd-2024-09-02-16-50-29" IN STORE "Uploads"
IGNORE MISSING UPDATES

And getting this Error:

ElevateDB Error #1305 Error loading the updates for the database Data (Unknown error occurred with the table People (ElevateDB Error #1004 The foreign key constraint ID for the table Farmers has been violated (Foreign keys exist which refer to the primary or unique key 1105000219 in the table People)))

--

I have Saved the Update file  "1013000004-Upd-2024-09-02-16-50-29" to a data-table so I can review it, and queries the update table to review all the rows present (which show the SQL that runs during the update).

It clearly contains records (as I would expect) adding the People record with ID: 1105000219, then adding rows of data for Child Records.

Then there are lines which DELETE each one of the child records
There there are lines which DELETEs the People Record.

These are all the rows that reference the ID 1105000219

This ID is NOT present on the central server.

I don't understand why the error is occurring. The process detailed in the update file should work fine.

Any help would be gratefully received.
Image