.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Service Broker Conflict

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :Sql Server


i want to make bi-diretctional replication between 2 databases each is one sql server instance,,after searching for the best way to do bi-directional replication i found that i can use service broker to exchange messages between 2 databases ,,but i have a question about conflict detecting and resolution and i need some help,,my question is how can i detect these type of conflicts that can be occured during exchanging messages ,,for examples,,

1-updating the same rows,,if each message containg the rows that are updated on each database .
2-updating rows on 1 database that are deleted on the other,,so when the message from data base 1 will contain an update statement for the rows that have been updated but when it arrives @ database 2 and executed the result will be 0 rows affected because those rows are deleted on database 2..
and there are other conflict,,i need some help or any ideas to know how can resolve those conflict ,,,
any suggestion will be highly apperciated

thnx all

View Complete Post

More Related Resource Links

how to resolve conflict when using sql service broker to do bidirectional replication?


greetings ,,

after spending days in search about the best practice to make bi-directional replication between 2 databases on 2 distributed sql server instances ,,i have found that sql server service broker is the most suitbale with my business req to use as i have a problem with the updatable subscrption replication due to leased line between networks in 1 MEGA and it will be large amount data that will be replicated and that will not work as the latency will increase ,,but i need some help to know how can i resolve these conflicts when i am using sql server broker service:

1-If you insert a record that has a key into a table on one of the servers and another record that has the same key already exists on the other servers that participate in the replication, the replication does not propagate the changes to the other servers.

2-When you update a column in a record that is updated at the same time on another server, the data may be different on the two servers.

3-When you update different columns in a record, simultaneous updates of different columns of a record may sometimes lead to conflicts.

4-When you delete a row that is being deleted at the same time on another server that is participating in the replication, the replication fails because the DELETE statement does not affect any rows on some of the subscribers.


WCF Service "DataContract" conflict error

Hi,I am consuming two wcf services in my workflow. The services have the same datacontract with name "Consumer".My Workflow building successfully, But when i am trying to publish my workflow i am getting the "consumer" datacontract conflit error. The error is :DataContract for type 'Service1.Consumer' cannot be added to DataContractSet since type 'Service2.Consumer' with the same data contract name 'Consumer' in namespace 'http://MyWorkflow' is already present and the contracts are not equivalent.Suggest me how to solve this conflict.Thanks in advance.

Service Broker Queue message activates stored Proc as SA but the stored proc is unable to access oth


I have a queue whose activation I defined as below

ALTER QUEUE SomeInitiatorQueue
PROCEDURE_NAME = usp_SomeProc,

Now I am trying to access another database in usp_SomeProc as below

Select SomeColumn SomeOtherDb.dbo.SomeTable

Here I am getting this error "The server principal "sa" is not able to access the database "SomeOtherDb" under the current security context."

It never allows unless I grant all permissions on the database to all.

what is the solution?

how to get xml messages from service broker?




i wana know how can i get your XML messages from service broker (in case of distributed brokers) and how to parse them to produce our data?



Verifying GRANT permissions on Service Broker CONTRACT and Queue


I am setting up SqlDependency and wish to verify that the permissions have been applied correctly.

One of the commands that should be run to grant permissions is to grant references on a contract for the user:

GRANT REFERENCES on CONTRACT::[http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification]  to [sql_dependency_subscriber]

How can I check whether the user e.g. 'databaseUser' has this REFERENCES granted on this contract? Which view/stored proc. to use?

The other command is similar (also required for SqlDependency) but grants permission "RECEIVE":

GRANT RECEIVE ON QueryNotificationErrorsQueue TO [sql_dependency_subscriber]

How could I verify that the RECEIVE permission has been granted?


I have currently used this command:

sys.database_permissions AS prmssn
INNER JOIN sys.database_principals AS grantee_principal
ON grantee_principal.principal_id = prmssn.grantee_principal_id
WHERE prmssn.class = 0

With this command I can see some permissions (such as CREATE PROCEDURE, CREATE QUEUE, etc.) but the above permissions related to  the contract and queue do not seem to show in the results from sys.database_permissions.

Thankful for any advice!


Optimizing tempdb for service broker based operations


SQL 2005 Standard.

I have an application based on Service Broker that is very very slow.

I know that service broker is based on tempdb and tried to optimize it moving on a separate disk and creating a different filegroup with new, big enough datafiles into it.
However it is still slow ..probably also due to the fact that sql server is a virtual machine with no dedicated disk.

Can you please recommend the best practices for dealing with high tempdb workload ?

Thanks !!

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

WCF Tip: Using Properties in Service Contracts

you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

Realizing a Service-Oriented Architecture with .NET

This article is meant to be a practical discussion guide to building a .NET application in a service-oriented architecture. We will consider real-world goals, real-world obstacles, and experience-based solutions. I quickly concede the approaches discussed here are not exhaustive or infallible. This paper is focused on application development, not application integration. We will specifically consider architectural issues and component design issues.

The Potential of Web Services

Web Service for uploading documents into SharePoint

WS UploadService is a web service written for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 and is meant for uploading documents into SharePoint. I have just uploaded the zip file to GotDotNet.com so it will take some time before the zip file appears in the list of downloads. For the time being, you can download the zip file from the following location

Creating and Using an ASP.NET Web Service in Visual Web Developer

In addition to letting you create Web pages, Microsoft Visual Studio also lets you create Web services that use ASP.NET XML. Creating a Web service in Visual Studio is similar to creating a Web page. You can also use the Microsoft Visual Web Developer Web development tool to reference and use Web services that are in a Visual Web Developer solution, on your local computer or in a local or external UDDI directory. In this walkthrough, you will create the Web service in one solution and use it in another.

Tasks illustrated in this walkthrough include:

Creating a simple XML Web service in Visual Web Developer.

Creating a separate Web site that uses the Web service.

AutoGenerateSelectButton="False" ignored when using Domain Service


Crosspost from RIA Services forum: http://forums.silverlight.net/forums/t/196466.aspx

I'm creating a Dynamic Data application in VS2010 and have recently switched to using a Domain Service to give greater control over the data presented to the client. I've noticed that the AutoGenerate<Action>Button attributes on my GridView are being ignored. The presence of the Edit and Delete buttons appear to be contingent on the existence of Update and Delete methods on the partial classes autogenerated in the Domain Service, but i'm not seeing how to control the generation of the Select button. Is there a way to control this from within the Domain Service class?

Any framework for creating a job scheduler service?


Just curious to know if there was any official Microsoft code blocks, classes, or such for writing a service that runs other assemblies or WCF services?  That can be configured easily from a web page, pre-coded, for running tasks at certain times on certain recurring intervals?  I've already built one but am open to anything done better- which I'm sure there is.  Thanks!!!

Convert WCF service to self hosting application


 I created project as a  WCF Service application and now according to recuriment that needs to be converted as a self hosting application

How can i do this?

Converting WCF service app to Self hosting app?

WCF Data Service to JSON example? v4


I would like to take WCF Data Service and produce JSON output to consume on various mobile apps.

Can anyone give me a how-to on the JSON part?  I.e., what is different than normal XML outut?



Problem to obtain client IP on web service



I'm having problems to obtain the client IP on web service. Here's my scenario:

One server with Windows 2003, hosting the web service using .Net Framework 2.0, with IP and host name ServerTransaction.
Other server with Windows 2003, hosting a web application using .Net Framework 2.0, that consuming the web service on  ServerTransaction, with IP and host name ServerApplication.
Many other computers on the local network (IPs:,,, ...) acessing the web application on ServerApplication.

On the code of the web service I've tried to use HttpContext.Current.Request.UserHostAddress or HttpContext.Current.Request.ServerVariables("REMOTE_ADDR") or HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FORR"), but always I can only get the IP of ServerApplication (

Any idea or tip?

Thanks and sorry for my bad english.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend