Question

I am developing c# application in which to send and get requests we use HTTP protocols. The c# application is running as server which is a console application, and the data manipulation(CRUD) done from the front end developed using flex. And another c# application which is a windows based act as client(Station) ,receive data from database. For that a request from station send to server as http request and server response back to the station with data and store data in local database where station exists. Now my problem is that if two stations running with same server and requesting for different databases, sometimes the data will get mismatch each other. Example if server contains two databases say db1 and db2.And station1 want data from db1 and station2 from db2.Some times Station1 gets db2 data and station2 gets db1 data. How is it possible.Please find a piece of code below.

private void LogRequest(SiteSession siteSession)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("({0}) {1} {2}",
Request.RemoteEndPoint.Address.ToString(),
Request.Method.ToUpper(),
Request.Uri.AbsoluteUri);

if (siteSession != null)
{
sb.AppendFormat("({0}/{1}/{2})",
siteSession.sessionId,
siteSession.site.Name,
siteSession.user.UserName);
}
else
{
sb.AppendFormat(" - not serviced, reason:no valid session");
}

TouchServer.Log(Logger.MessageType.Trace, 1, sb.ToString());

if (TouchServer.showURLs)
{
Console.WriteLine("{0}: {1}", DateTime.Now, sb.ToString());
}

}

Please let me know the possiblities. Thank you. Regards sangita

Was it helpful?

Solution

The problem obviously connected to database connection string . You can write connection strings to log or to debug view

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top