antropka
antropka

Reputation: 21

Two way replication SymmetricDS

I have a two databases: oracle & postgres. SymmetricDS is syncing the tables in two way directions. It seems that everything is working. But I need a logic based on triggers that corrects the inserted/updated rows "on the fly". This triggers must be located in the oracle DB.

The algorithm should be as follows:

  1. User inserts new line to the PostgreSQL.
  2. SymmetricsDS replicate this line to the Oracle.
  3. Oracle's triggers converts some columns "on the fly" to the new one.
  4. This converted line must be returned from oracle to postgres back.
  5. I'm creating last AFTER trigger (based on the FOLLOWS statement) on oracle that inserts into SYM_DATA table this renewed line.
  6. I'm waiting that SymmetricsDS will be replicate this corrected line to the postgres back. But nothing happened. Postgres line is old style, such as inserted by user, without oracle's trigger logic.

What am I doing wrong? What else can I do to implement my algorithm?

Upvotes: 1

Views: 904

Answers (1)

Boris Pavlović
Boris Pavlović

Reputation: 64640

Write your own implementation of org.jumpmind.symmetric.io.data.writer.DatabaseWriterFilterAdapter at Oracle DB's side. This interceptor will do the job of the step 3 (and step 5).

Upvotes: 0

Related Questions