Showing posts with label resolver. Show all posts
Showing posts with label resolver. Show all posts

Monday, March 19, 2012

Custom Resolver in SQL Server 2005

I'm trying to implement .NET based custom resolver for SQL Server 2005. MS
example shows how to work with publisher / subscriber record data only. To
resolve a conflict I need more info about the business object represented by
record data. I need to run a query / procedure for this purpose. To make a
connection from within my resolver user / password are required. No such
thing is available in 'Microsoft.SqlServer.Replication.BusinessLogicSupp ort'
class.
Note: In SQL Server 2000 VB based COM custom resolver I have
'IReplRowChange' object as an INPUT param for 'IVBCustomResolver_Reconcile'
method which has 'GetSourceConnectionInfo' / 'GetDestinationConnectionInfo'
methods to get to GetLogin / GetPassword and than use ADODB to create a
connection string to run query or sp.
Appreciate any help on this subject.
Is there any workaround to use Custom Resolver COM created for SQL Server
2000 implementing IVBCustomResolver for SQL Server 2005?
|||I've found an example in
C:\Program Files\Microsoft SQL
Server\90\Samples\Replication\Merge\BusinessLogic\ CS
Thanks All

Custom Resolver for merge replication

Hi there!
I'm trying to create a custom resolver for merge replication exactly like in the MS example.
It seems to work, but only ONE time. If I change, insert or delete a record in a table the second time, the subscriber monitor comes with the following errors:

Error messages:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199411)
The Merge Agent encountered an error when executing code in the 'UpdateHandler' method implemented in the business logic handler 'D:\Program Files\Microsoft SQL Server\90\COM\MyResolver.dll'. Ensure that the overridden 'UpdateHandler' method has been properly implemented in the business logic handler. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199411)
This last error is of course dependant on my action (update, delete, insert).
My code is -exactly- like the example (I just stripped out the log message).
Does anyone know why I am "trying to read or write protected memory" ?
The thing is that I'm trying to create an application that detects if a table changes. Is this the right way to do this anyway or are there better solutions?
Any help is appreciated! Thanks!

Hi there!

Any resolution to the problem described in the post? I'm getting the same problem with custom resolver.

Custom Resolver for merge replication

Hi there!

I'm trying to create a custom resolver for merge replication exactly like in the MS example.

It seems to work, but only ONE time. If I change, insert or delete a

record in a table the second time, the subscriber monitor comes with

the following errors:

Error messages:

Attempted to read or write protected memory. This is often an

indication that other memory is corrupt. (Source: MSSQL_REPL, Error

number: MSSQL_REPL-2147199411)

The Merge Agent encountered an error when executing code in the

'UpdateHandler' method implemented in the business logic handler

'D:\Program Files\Microsoft SQL Server\90\COM\MyResolver.dll'. Ensure

that the overridden 'UpdateHandler' method has been properly

implemented in the business logic handler. (Source: MSSQL_REPL,

Error number: MSSQL_REPL-2147199411)

This last error is of course dependant on my action (update, delete, insert).

My code is -exactly- like the example (I just stripped out the log message).

Does anyone know why I am "trying to read or write protected memory" ?

The thing is that I'm trying to create an application that detects if a

table changes. Is this the right way to do this anyway or are there

better solutions?

Any help is appreciated! Thanks!

Hi there!

Any resolution to the problem described in the post? I'm getting the same problem with custom resolver.

Saturday, February 25, 2012

Custom conflict resolver example code in C#

Hi!

I'm trying to create a custom conflict resolver for SQL Server 2000 in

C# but i can't seem to find any source code examples of a *.dll where i

can actually see what needs to be done.

Any help is welcome.

Thanks

In SQL 2000, you can only do this in VB, C# isn't supported. However in SQL 2005, you can definitely use C#.

|||Thanks,

so that's why i couldn't find anything in C# :/

Going to try and find a different approach then.

Custom conflict resolver example code in C#

Hi!

I'm trying to create a custom conflict resolver for SQL Server 2000 in

C# but i can't seem to find any source code examples of a *.dll where i

can actually see what needs to be done.

Any help is welcome.

Thanks

In SQL 2000, you can only do this in VB, C# isn't supported. However in SQL 2005, you can definitely use C#.

|||Thanks,

so that's why i couldn't find anything in C# :/

Going to try and find a different approach then.

Custom Conflict Resolver

Hi there,

I have created a custom conflict resolver for an article that is using Merge replication. I can register my custom resolver OK, I can change my merge article to use my new custom resolver, but when a conflict occures the replication monitor shows the following errors:

Error messages:

No signature was present in the subject.
(Source: MSSQL_REPL, Error number: MSSQL_REPL-2146762496)
Get help: http://help/MSSQL_REPL-2146762496

The Custom Resolver Component for article 'BRANCH' does not have a valid digital signature. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147198713)
Get help: http://help/MSSQL_REPL-2147198713

At first I thought it was because my assembly wasn't signed, so I signed it. I still get the same error.

I have various debug statements in the assembly and I can see that Initialize and HandleChangeStates gets called ok, but no other overrides.

Can anyone help me please?

Thanks

Graham

Hi Graham

When you added the article with sp_addmergearticle did you want the the signature verified?

[@.verify_resolver_signature = ] verify_resolver_signature

Specifies if a digital signature is verified before using a resolver in merge replication. verify_resolver_signature is int, with a default of 0. 0 specifies that the signature will not be verified. 1 specifies that the signature will be verified to see if it is from a trusted source.

See here for more info:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_repl_11et.asp

Thanks

Nabila Lacey

This posting is provided "AS IS" with no warranties, and confers no rights.

|||Hi there Gravy, i'm new in merge replication, conflict resolution, procedures and more.

I managed to make a replication from a PC to a PPC, and it works, but now i have conflicts updating colums, i never worked with procedures, and i'll have to do one to problaby solve my conflict cause i think i dont need any of the com based resolvers.

Could you explain me how i do a procedure to conflict resolver? if possible the steps, how can i get the publisher table and subscriber table with conflicts, ao can i make some calculations with them and put in the final column to be correct values.

If your could give me some procedure example, or your example, i would be greatfull.
I've read lots of Book online and foruns, and ive not discovered nothing that i need, but i think maybe you could help me.

Thanks in advance

Custom Conflict Resolver

Hi there,

I have created a custom conflict resolver for an article that is using Merge replication. I can register my custom resolver OK, I can change my merge article to use my new custom resolver, but when a conflict occures the replication monitor shows the following errors:

Error messages:

No signature was present in the subject.
(Source: MSSQL_REPL, Error number: MSSQL_REPL-2146762496)
Get help: http://help/MSSQL_REPL-2146762496

The Custom Resolver Component for article 'BRANCH' does not have a valid digital signature. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147198713)
Get help: http://help/MSSQL_REPL-2147198713

At first I thought it was because my assembly wasn't signed, so I signed it. I still get the same error.

I have various debug statements in the assembly and I can see that Initialize and HandleChangeStates gets called ok, but no other overrides.

Can anyone help me please?

Thanks

Graham

Hi Graham

When you added the article with sp_addmergearticle did you want the the signature verified?

[@.verify_resolver_signature = ] verify_resolver_signature

Specifies if a digital signature is verified before using a resolver in merge replication. verify_resolver_signature is int, with a default of 0. 0 specifies that the signature will not be verified. 1 specifies that the signature will be verified to see if it is from a trusted source.

See here for more info:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_repl_11et.asp

Thanks

Nabila Lacey

This posting is provided "AS IS" with no warranties, and confers no rights.

|||Hi there Gravy, i'm new in merge replication, conflict resolution, procedures and more.

I managed to make a replication from a PC to a PPC, and it works, but now i have conflicts updating colums, i never worked with procedures, and i'll have to do one to problaby solve my conflict cause i think i dont need any of the com based resolvers.

Could you explain me how i do a procedure to conflict resolver? if possible the steps, how can i get the publisher table and subscriber table with conflicts, ao can i make some calculations with them and put in the final column to be correct values.

If your could give me some procedure example, or your example, i would be greatfull.
I've read lots of Book online and foruns, and ive not discovered nothing that i need, but i think maybe you could help me.

Thanks in advance

Custom Conflict Resolver

Hi All,
I'm using a custom conflict resolver (using stored procedure) for one of any
articles.
I want to determine which columns were in conflict in this stored procedure.
Could you pls point me to some pointers on how to achieve the same.
Thanking you.....
I don't believe this can be done. If you are using column level tracking you
might be able to parse the message returned.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Pinkesh" <Pinkesh@.discussions.microsoft.com> wrote in message
news:9E9B4BA9-BCCF-4FE6-8EE4-C5A506B87E73@.microsoft.com...
> Hi All,
> I'm using a custom conflict resolver (using stored procedure) for one of
any
> articles.
> I want to determine which columns were in conflict in this stored
procedure.
> Could you pls point me to some pointers on how to achieve the same.
> Thanking you.....
>
>
|||Hi Hilary,
Thanks for the prompyt reply.
I'm using Column level tracking for my publication.
Sorry but I didn't understand what you mean by "parse the message returned".
Could you pls help by providing some details regarding it.
Thanking you.
"Hilary Cotter" wrote:

> I don't believe this can be done. If you are using column level tracking you
> might be able to parse the message returned.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> "Pinkesh" <Pinkesh@.discussions.microsoft.com> wrote in message
> news:9E9B4BA9-BCCF-4FE6-8EE4-C5A506B87E73@.microsoft.com...
> any
> procedure.
>
>