I have 2 programs:
- A server that produce data and insert it in MSSQL(written with C++ and use ODBC for connection).
- A client that read data from MSSQL and show it to the user(written in .NET(C#, VB) and use .Net SqlClient).
Now my problem is when my server is running and insert data into MSSQL, my client can’t select data from it or even sometime the connection will be failed. Currently I am running both server and client on a single machine but they should run on network! I try to increase connection timeout in my connection string and it work sometime but not always. My server load is not too high(may be one insert every second). So what is wrong in my server and what should I do to find the error?
If the reading client can’t connect, you need to understand why. That has nothing to do with the other client writing.
If the reading client is connecting OK but the query it issues times out, and the query should safely execute in, say, a few seconds, that’s an indication of a lock (perhaps held by a transaction that was never committed). When the problem occurs, check things like sys.dm_tran_locks on the server for a process holding a lock on the table.