Patent ID: 11934424
Assignee: GRAVIC, INC.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 11:
12. An apparatus for avoiding target database constraint violations when replicating source database transactions from a source database to a target database, wherein target database transactions automatically abort due to constraint violations, each database having one or more tables, at least one of the target database tables having one or more constraints, the apparatus comprising a database replication system configured to perform the following steps for each target database transaction corresponding to a replicated source database transaction:
(a) replicate changes made at the source database to the target database;
(b) detect when a replicated change causes a constraint violation as a result of one or more of the target database tables having one or more constraints;
(c) defer the applying of the database change to the target database of the detected database change and post the detected database change to an electronic list;
(d) immediately apply the replicated changes to the target database that do not cause a constraint violation;
(e) repeat the replicating, detecting, deferring, and immediate applying for all of the changes within the replicated source database transaction;
(f) iterate through the database changes on the electronic list by:
(i) applying the database changes on the electronic list that no longer cause a constraint violation to the target database and removing the applied database changes from the electronic list, and
(ii) defer again the applying of the database changes on the electronic list that still cause a constraint violation and maintain the deferred database changes on the electronic list; and

(g) perform a commit for the target database transaction corresponding to the replicated source database transaction when a commit operation is detected in the replicated source database transaction, and when no database changes remain on the electronic list for the replicated source database transaction,
wherein the deferring avoids the target database transactions automatically aborting due to constraint violations.