Showing posts with label conflict. Show all posts
Showing posts with label conflict. Show all posts

Wednesday, March 28, 2012

Replication Error

I have a database thats got sql as the engine and access 2000 for the client side.Now my problem is every time I edit a record this "Write Conflict" comes up. I did some investigating and I found out its due to a REPLICATIONCONFLICT ERROR.
Can anyone help me plsIs your Access FE running against a database that participates in merge replication? You need to have a serious talk with your DBA about whether you should be developing any app using a db that is already part of another app.|||the only application involved is access 2000, and the network techs are the dba|||what do you mean pls explain FE??sql

Monday, March 26, 2012

replication conflict when use BEGIN TRANSACTION COMMIT TRANSACTION

Ok let me explain my problem
I update table abc to SERVER A
SERVER A push a replication to SERVER B
and SERVER B push to SERVER A and SERVER C
SERVER A and C are configure to replicate to SERVER B and
SERVER B is configure to replicate to SERVER A and SERVER C
(same tables are replicate)
I have no problem while I not use BEGIN TRANSACTION UPDATE... COMMIT
TRANSACTION
When I use BEGIN TRANSACTION UPDATE... COMMIT TRANSACTION I got a conflict
error
supp info:
2 Queued update conflict. Subscriber wins. Updating Publisher ...
"rl" <rlavoie@.lgs.com> wrote in message
news:%23jnEqEGjFHA.1232@.TK2MSFTNGP15.phx.gbl...
> Ok let me explain my problem
> I update table abc to SERVER A
> SERVER A push a replication to SERVER B
> and SERVER B push to SERVER A and SERVER C
> SERVER A and C are configure to replicate to SERVER B and
> SERVER B is configure to replicate to SERVER A and SERVER C
> (same tables are replicate)
> I have no problem while I not use BEGIN TRANSACTION UPDATE... COMMIT
> TRANSACTION
> When I use BEGIN TRANSACTION UPDATE... COMMIT TRANSACTION I got a conflict
> error
>

Replication conflict tables

Greetings!
We have been running transactional replication environment in development and QA test. The other evening in a "emergency", development requested several table changes to many of the published tables. I was out of the office and with no laptop available,
I tried to blindly guide a coworker through the process of reestablishing the articles and the subscription (not entirely sure of what he had removed). Apparently, we erred and he published and subscribed everything, but now we have a conflict_ table fo
r every single table in the publication. None of the tables have any rows. The published and subscriber database are both on the same server (as is the distribution database).
I can remove the conflict tables for the subscriber database, but they also exist in the published database as system tables which can't be dropped. I haven't run across an sp that can remove these and am thinking I won't be able to short of rebuilding t
he database. Might've SQL Server gotten the idea that this was to be merge replication? That seems like the only reason I got these. Is there any clean way to remove these conflict tables without rebuilding the database?
Thanks much in advance!
Steve
It sounds like he created a merge publication and then deleted it. You can
safely drop these conflict tables (as long as you aren't running any merge,
immediate updating or queued updating subscribers) by runing the following
command in QA
select 'drop table '+name from sysobjects where name like 'conflict_%'
Then in your results pane select the results and then paste it back in the
Query pane, and exectue it.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Steve H" <shoerle@.charter.net> wrote in message
news:19042C30-8B0A-41D3-AD44-4DE62725C3C2@.microsoft.com...
> Greetings!
> We have been running transactional replication environment in development
and QA test. The other evening in a "emergency", development requested
several table changes to many of the published tables. I was out of the
office and with no laptop available, I tried to blindly guide a coworker
through the process of reestablishing the articles and the subscription (not
entirely sure of what he had removed). Apparently, we erred and he
published and subscribed everything, but now we have a conflict_ table for
every single table in the publication. None of the tables have any rows.
The published and subscriber database are both on the same server (as is the
distribution database).
> I can remove the conflict tables for the subscriber database, but they
also exist in the published database as system tables which can't be
dropped. I haven't run across an sp that can remove these and am thinking I
won't be able to short of rebuilding the database. Might've SQL Server
gotten the idea that this was to be merge replication? That seems like the
only reason I got these. Is there any clean way to remove these conflict
tables without rebuilding the database?
> Thanks much in advance!
> Steve

Replication conflict resolver

Hi Everyone!
Here another post on replication.

When conflict occur, I want the user to be able to select witch row to keep and witch to delete.

I've look for system stored procedure, that could help me do the resolution but I've founded nothing.

So I've thought that I could do it by hand, with UPDATE/DELETE query
Take the row in the %TABLE_NAME%_Conflict table and copy it into the real table, than delete the row.

I this the good way of doing it?

Is there any other way?

Thanks !No one, here have a custom conflict resolver ?|||

Hi Zakary,

It sounds like you are wanting to replicate - excuse the pun - the interactive conflict resolver.

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/repref9/html/56cb122d-9b1e-4f79-81de-0118023d1004.htm

and ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rpldata9/html/172c60c7-f605-4eb5-b185-54ae9e9d3c60.htm

|||

Thanks For your reply!

Those help topic, is about SQL 2005 and I’m using MSDE(SQL 2000).

I don't want to use SQL Conflict resolver, but a custom VB .NET Front-end, to resolve conflict. And I was wondering if my approach is appropriate or not.

Thanks

|||

Here is a sql 2000 link.

http://msdn2.microsoft.com/en-us/library/aa179421(SQL.80).aspx

I was thinking that although this might not give you exactly what you want you might be able to copy how it works functionally.

Cheers, James

Replication Conflict Notification

Is there a way I can be notified when a merge replication resolves/shows a
conflict. Maybe e-mail or something?
Thanks,
Steve
There is interactive conflict resolution. You could also have a job which
will run and query the conflict tables, or place triggers on the conflict
tables
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"SteveInBeloit" <SteveInBeloit@.discussions.microsoft.com> wrote in message
news:9BA89624-D1FA-4C6D-90ED-13FA51D4F5F4@.microsoft.com...
> Is there a way I can be notified when a merge replication resolves/shows a
> conflict. Maybe e-mail or something?
> Thanks,
> Steve
|||Thanks Hilary,
When do the rows from the conflict tables get deleted? Ours are always
empty. We do have the snapshot agent running every night, is that doing it?
Thanks,
Steve
"Hilary Cotter" wrote:

> There is interactive conflict resolution. You could also have a job which
> will run and query the conflict tables, or place triggers on the conflict
> tables
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "SteveInBeloit" <SteveInBeloit@.discussions.microsoft.com> wrote in message
> news:9BA89624-D1FA-4C6D-90ED-13FA51D4F5F4@.microsoft.com...
>
>
|||IIRC they are purged when the history retention period has passed.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"SteveInBeloit" <SteveInBeloit@.discussions.microsoft.com> wrote in message
news:2BB8DB35-8636-4EFD-868F-0A9BBA4AFB00@.microsoft.com...[vbcol=seagreen]
> Thanks Hilary,
> When do the rows from the conflict tables get deleted? Ours are always
> empty. We do have the snapshot agent running every night, is that doing
> it?
> Thanks,
> Steve
> "Hilary Cotter" wrote:

Friday, March 23, 2012

replication conflict error.. how to add datas to publisher ....

Hi..

I have configured publisher, distributer,subscriber... and tried to replicate it... it has done successfully...

When i try to add datas to the publisher ... it says

"conflict error"

can you please tell me how to check the replication is successfull or not.

and i want to add datas to publisher so that it should frequently updated in subscriber...

You should start by reading Books Online topic "How Merge Replication Detects and Resolves Conflicts". You can also read Replication topics about merge replication in general to get a better undestanding about how it works and how it's best used.sql

Replication Conflict Auto Notification (How)

Hi

I'm Running SQL 2k - Mainly Merge Replication.

Can Someone point me in the right direction on how best to Alert myself/Operator via email when a conflict occurs.

I use xp_sendmail regularly so can deal with that part

I've tried looking for a solution but with no success.

Having to keep opening the Conflict Viewer to check is becomming a Bit Tiresome.

The Only way I can think of is running a batch Job to look at the rowcount of conflict tables (Possibly using a cursor and dynamically built Select Count(*) statements from sysobjects to get conflict table names).

or

If Conflicts are flagged in the system Replication tables query them but I don't know which table if any exist.

Theres gotta be an easier way - I must be missing something

Any Help Greatly appreciated

thx

GWCheck Lumigent (http://www.lumigent.com) website for latest tool on notification and its free.|||Cool

thx again Satya

GW

replication conflict at deleting

Hello I have a question.
We have a merge replication between 4 servers and it's working fine but we
had a conflict while deleting a record in a master table wich has the
location and product as a key that says :
"The same row was updated at 'servername1.replication' and deleted at
'servername2.replication'. The resolver chose the update as the winner"
It looks like the same record was updated and deleted in a diferent site,
but first it's imposible because every site touches the products of their
own location, the programs that access the database only inserts, updates or
deletes the records of the location where the user logged belongs. Plus
everytime I delete or update or insert a record in this master table we
insert a transaction record for control.
We had the problem and I can see that the user never updated this master
file because I don't have a transaction for update and they deleted the
record but it never got deleted and the problem is that now I have my master
file with records that are not soppoused to be there anymore.
Is there any other reason why this error comes because as I said they never
updated the record and how can I set replication for the deleted as a winner
in every process.
Thanks in advance
Jennyfer
The conflict resolver will give you enough information to accurately identify
the record that is being updated/deleted.
Before you say it is impossible look at these details and compare them.
If the records match then you need to look at your log files and find out
who is deleting and then who is changing this record.
It sounds like replication has discovered an activity that you were not
aware of.
Jim.
"Jennyfer J Barco" wrote:

> Hello I have a question.
> We have a merge replication between 4 servers and it's working fine but we
> had a conflict while deleting a record in a master table wich has the
> location and product as a key that says :
> "The same row was updated at 'servername1.replication' and deleted at
> 'servername2.replication'. The resolver chose the update as the winner"
> It looks like the same record was updated and deleted in a diferent site,
> but first it's imposible because every site touches the products of their
> own location, the programs that access the database only inserts, updates or
> deletes the records of the location where the user logged belongs. Plus
> everytime I delete or update or insert a record in this master table we
> insert a transaction record for control.
> We had the problem and I can see that the user never updated this master
> file because I don't have a transaction for update and they deleted the
> record but it never got deleted and the problem is that now I have my master
> file with records that are not soppoused to be there anymore.
> Is there any other reason why this error comes because as I said they never
> updated the record and how can I set replication for the deleted as a winner
> in every process.
> Thanks in advance
> Jennyfer
>
>
|||Yes I indentify what is the record being deleted and "update" at the same
time and in my log files I have the transaction for delete but not for
update. But I know that replication discovered some how an activity for this
record.
"Jim Breffni" <JimBreffni@.discussions.microsoft.com> wrote in message
news:4C1F2708-5F98-402C-B4D5-2950FB356CF4@.microsoft.com...
> The conflict resolver will give you enough information to accurately
identify[vbcol=seagreen]
> the record that is being updated/deleted.
> Before you say it is impossible look at these details and compare them.
> If the records match then you need to look at your log files and find out
> who is deleting and then who is changing this record.
> It sounds like replication has discovered an activity that you were not
> aware of.
> Jim.
>
> "Jennyfer J Barco" wrote:
we[vbcol=seagreen]
site,[vbcol=seagreen]
their[vbcol=seagreen]
updates or[vbcol=seagreen]
master[vbcol=seagreen]
never[vbcol=seagreen]
winner[vbcol=seagreen]

Replication conflict

Hi,
I am using SQL Server 2005 replication. In the Conflict Viewer I have the
following message for the conflict being reported.
The same row was updated at both
'[Publisher]'
and '[Subscriber]'.
The resolver chose the update from '[Publisher]' as the winner.
The table is not filtered and does have one Trigger:
ALTER TRIGGER [dbo].[Last_mod_date] ON [dbo].[TitleMaster]
FOR INSERT, UPDATE NOT FOR REPLICATION
AS
DECLARE @.chvLastModUser VARCHAR(20), @.dtmLastModDate DATETIME, @.uidID
UNIQUEIDENTIFIER
SELECT @.uidID = tm_row_id
FROM inserted
SELECT @.chvLastModUser =
REPLACE(SUSER_SNAME(),LEFT(SUSER_SNAME(),CHARINDEX ('\',SUSER_SNAME())),'')
SELECT @.dtmLastModDate = GETDATE()
UPDATE titlemaster SET
tm_last_mod_date = @.dtmLastModDate,
tm_last_mod_user = @.chvLastModUser
WHERE tm_row_id = @.uidID
This problem does not take place for all records.
Help will be greatly appreaciated.
Thanks!
Ben
Ben,
are you saying there shouldn't be a conflict at all ie the same row hasn't
been changed at publisher and subscriber? Also are you saying that the
trigger is causing this problem? I'm not too clear. Although I'm guessing
here because of not knowing the above issues, is the column "tm_row_id"
unique ie are there any duplicates of "tm_row_id"?
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
|||First off I think your trigger is incorrect. It is only good for singleton
inserts and updates. Are you certain you only have singleton inserts and
updates? In other words do you only insert and update one row at a time?
I think the trigger should look like this
alter TRIGGER [dbo].[Last_mod_date] ON [dbo].[TitleMaster]
FOR INSERT, UPDATE NOT FOR REPLICATION
AS
UPDATE titlemaster SET
tm_last_mod_date = GETDATE(),
tm_last_mod_user =
REPLACE(SUSER_SNAME(),LEFT(SUSER_SNAME(),CHARINDEX ('\',SUSER_SNAME())),'')
from titlemaster ,inserted
WHERE titlemaster.tm_row_id = inserted.tm_row_id
You might find this performs better, not to mention being more accurate
Secondly, it looks like this statement
REPLACE(SUSER_SNAME(),LEFT(SUSER_SNAME(),CHARINDEX ('\',SUSER_SNAME())),''),
is removing the domain name, whereas this will perform better for you.
select case when charindex(SUSER_SNAME(),'\')>0 then
right(SUSER_SNAME(),CHARINDEX('\',SUSER_SNAME()))
else SUSER_SNAME() end
You need the case statement in there to handle sql authenticated users.
Thirdly there is the whole issue of using a guid column as a pk, consult
http://databases.aspfaq.com/database/what-should-i-choose-for-my-primary-key.html
Finally your replication problem. If the same row is updated on both sides
between sync's you will have a conflict. The way your trigger is written
this will always be the case, even with column level tracking. The not for
replication clause ensures that replication processes do not cause this
conflict.
How is the data updated/inserted? Is it from identical feeds?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Ben" <Ben@.discussions.microsoft.com> wrote in message
news:A2702486-3172-4A02-84F0-36061BEB7944@.microsoft.com...
> Hi,
> I am using SQL Server 2005 replication. In the Conflict Viewer I have the
> following message for the conflict being reported.
> The same row was updated at both
> '[Publisher]'
> and '[Subscriber]'.
> The resolver chose the update from '[Publisher]' as the winner.
>
> The table is not filtered and does have one Trigger:
> ALTER TRIGGER [dbo].[Last_mod_date] ON [dbo].[TitleMaster]
> FOR INSERT, UPDATE NOT FOR REPLICATION
> AS
> DECLARE @.chvLastModUser VARCHAR(20), @.dtmLastModDate DATETIME, @.uidID
> UNIQUEIDENTIFIER
> SELECT @.uidID = tm_row_id
> FROM inserted
> SELECT @.chvLastModUser =
> REPLACE(SUSER_SNAME(),LEFT(SUSER_SNAME(),CHARINDEX ('\',SUSER_SNAME())),'')
> SELECT @.dtmLastModDate = GETDATE()
> UPDATE titlemaster SET
> tm_last_mod_date = @.dtmLastModDate,
> tm_last_mod_user = @.chvLastModUser
> WHERE tm_row_id = @.uidID
> This problem does not take place for all records.
> Help will be greatly appreaciated.
> Thanks!
> Ben
|||Hi Paul,
- There should not be a conflict. The row was modified at the Publisher but
not at the Subscriber.
- I don't think the trigger is causing the problem, according to the NOT FOR
REPLICATION statement, it is not supposed to happen. I just wanted to add
information that could aid in troubleshooting.
- The tm_row_id is unique and there are no duplicates.
Thanks for your help.
Ben
"Paul Ibison" wrote:

> Ben,
> are you saying there shouldn't be a conflict at all ie the same row hasn't
> been changed at publisher and subscriber? Also are you saying that the
> trigger is causing this problem? I'm not too clear. Although I'm guessing
> here because of not knowing the above issues, is the column "tm_row_id"
> unique ie are there any duplicates of "tm_row_id"?
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
>
>
|||Hi Hilary,
In this case, the same row was not modified in both ends. Will removing the
trigger stop this problem?
The data into this table is added by an end user at the Publisher. The
Publisher is the only one that has any interaction with this table when it
comes to inserting and updating.
Thanks for your help
Ben
"Hilary Cotter" wrote:

> First off I think your trigger is incorrect. It is only good for singleton
> inserts and updates. Are you certain you only have singleton inserts and
> updates? In other words do you only insert and update one row at a time?
> I think the trigger should look like this
> alter TRIGGER [dbo].[Last_mod_date] ON [dbo].[TitleMaster]
> FOR INSERT, UPDATE NOT FOR REPLICATION
> AS
> UPDATE titlemaster SET
> tm_last_mod_date = GETDATE(),
> tm_last_mod_user =
> REPLACE(SUSER_SNAME(),LEFT(SUSER_SNAME(),CHARINDEX ('\',SUSER_SNAME())),'')
> from titlemaster ,inserted
> WHERE titlemaster.tm_row_id = inserted.tm_row_id
> You might find this performs better, not to mention being more accurate
> Secondly, it looks like this statement
> REPLACE(SUSER_SNAME(),LEFT(SUSER_SNAME(),CHARINDEX ('\',SUSER_SNAME())),''),
> is removing the domain name, whereas this will perform better for you.
> select case when charindex(SUSER_SNAME(),'\')>0 then
> right(SUSER_SNAME(),CHARINDEX('\',SUSER_SNAME()))
> else SUSER_SNAME() end
> You need the case statement in there to handle sql authenticated users.
>
> Thirdly there is the whole issue of using a guid column as a pk, consult
> http://databases.aspfaq.com/database/what-should-i-choose-for-my-primary-key.html
> Finally your replication problem. If the same row is updated on both sides
> between sync's you will have a conflict. The way your trigger is written
> this will always be the case, even with column level tracking. The not for
> replication clause ensures that replication processes do not cause this
> conflict.
> How is the data updated/inserted? Is it from identical feeds?
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Ben" <Ben@.discussions.microsoft.com> wrote in message
> news:A2702486-3172-4A02-84F0-36061BEB7944@.microsoft.com...
>
>
|||Actually I think the problem could be time zone related. Are both servers in
the same time zone?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Ben" <Ben@.discussions.microsoft.com> wrote in message
news:3674B984-520E-4FE2-8366-AEC079D3F410@.microsoft.com...[vbcol=seagreen]
> Hi Hilary,
> In this case, the same row was not modified in both ends. Will removing
> the
> trigger stop this problem?
> The data into this table is added by an end user at the Publisher. The
> Publisher is the only one that has any interaction with this table when it
> comes to inserting and updating.
> Thanks for your help
> Ben
>
> "Hilary Cotter" wrote:
|||Ben - what I'd do is when it occurs, see what is the difference between the
rows ie what has changed on the subscriber which is unexpected? Then perhaps
use a log explorer tool to see what is causing the subscriber row to change
in this way.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
|||Hi Hilary,
They are both in the same city. The computer time could be slightly off.
Thanks
Ben
"Hilary Cotter" wrote:

> Actually I think the problem could be time zone related. Are both servers in
> the same time zone?
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Ben" <Ben@.discussions.microsoft.com> wrote in message
> news:3674B984-520E-4FE2-8366-AEC079D3F410@.microsoft.com...
>
>
|||Paul,
I will look to see what is different.
Thanks
Ben
"Paul Ibison" wrote:

> Ben - what I'd do is when it occurs, see what is the difference between the
> rows ie what has changed on the subscriber which is unexpected? Then perhaps
> use a log explorer tool to see what is causing the subscriber row to change
> in this way.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
>
>
>
|||Hi Hilary,
I made the change to the trigger, but I am still having conflicts. I had to
re-do the replication and while the publisher was creating the publication I
noticed the following in the log:
the foreign key 'dbo.Order.FK_Orders_Stores' will not be scripted for
article 'Orders' because it references the key contraint
'dbo.Stores.IX_st_row_id' that is replicated only as an index
I could not find any reference to this message, and I was wondering if you
knew or could point me in the right direction.
Thanks for your help!
Ben
"Hilary Cotter" wrote:

> Actually I think the problem could be time zone related. Are both servers in
> the same time zone?
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
>
> "Ben" <Ben@.discussions.microsoft.com> wrote in message
> news:3674B984-520E-4FE2-8366-AEC079D3F410@.microsoft.com...
>
>