on 2024 Jan 18 12:05 AM
So I think I know the answer Reg. LOL!
I'm working with a team that is running 12 SQL Anywhere 17 databases in their Linux server environment.
Build 17.0.11.7312
In a nutshell, they are wanting to use SQL Remote to pass all data changes from the production database, down to a QA and Test database running in Azure. See image attached.
So production replicating to both QA and Test. And, to add a caveat, we are only replicating in one direction. So production will replicate down to QA and Test. Also, QA and Test will only be receiving from Prod. So data will not be going back.
So in a nutshell, we set up blanket publications and subscriptions against all the tables.
One of these tables however has a 5 part composite Primary Key. And unfortunately when this was designed YEARS AGO, the developer didn't see this as problematic.
So after we had applied the publication and subscriptions, we started testing the database and we got the following error....
Could not execute statement. Cannot update primary key for table "deposit summary' involved in a publication SQLCODE=-780, ODBC 3 STATE="42S02" Line 1, column 1
So I start pondering what is going on and it dawns on me. If the primary key value changes and that composite key no longer exists in the other environment, replication would fail for that action.
So we keep doing some digging and we find the "prevent_article_pkey_update" option on the database.
When we turned this off, the update statement immediately started working.
The impression I have is this. What kind of problem are we making for ourselves by turning this option off? The thought I have is that if someone updates a row in the QA database or the Test database that matches the key in production, that update would fail.
But what if we left the option on within test and QA, but off on the production side?
Thinking through the process, I'm feeling like that key value would be gone again, and the replication of that information would fail.
Why anyone would allow to update a primary key just floors me. But it's used in their batch processes.
I'm just trying to get my arms wrapped around what kind of other gotchas they could run into by going this direction.
I'm looking for anyone else that has run into this situation.
Thanks everyone!
User | Count |
---|---|
67 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.