Reputation: 705
I'm running two instances of SymmetricDS with MySQL.
I have to start and stop synchronizations, for that I use:
update sym_channel set enabled=0/1;
For some reason when they synchronize (enabled=1
), I get the following error:
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`test_db`.`defectstdreference`, CONSTRAINT `Relationship72` FOREIGN KEY (`improve_notice_doc_id`, `defect_id`, `client_id`) REFERENCES `improvementnoticedefect` (`doc_id`, `defect_id`, `client)
Yet, in some time synchronization finishes successfully, so all this exception does is significantly slowing down the process.
Do you have any idea what may have casued this?
Upvotes: 2
Views: 185
Reputation: 79
Have you created your own channels or are you using default?
If you created your own they can synchronize independently of each other. As a result if you have a foreign key between two tables and the parent table uses channelA and the child table uses channelB its possible that changes in channelB could synchronize before channelA thus causing a foreign key error. At times channelB may process after channelA so this might explain the unexpected behavior. SymmetricDS will retry any batches in error so eventually it gets them in order. To avoid these errors though all together make sure if your using custom channels that all related tables participate in the same channel.
Upvotes: 3