Stanton_Roux
asked on
C# Application locking tables
Hi There
I have a application written in c# that imports data into a database every couple of seconds.
I also have a website that talks to the same database.
My problem is that when the application inserts or updates data it locks the table that it is updating.
This Causes request from the website to fail when searching for data in those tables.
The request from the website should take preferrence over everything.
So is there a way of configuring SQL to set priority to a particular transaction or to help solve this problem.
Or is there a way either in code or by configuring SQL so that the application only locks the record
that it is using and not the whole table.
thanks
I have a application written in c# that imports data into a database every couple of seconds.
I also have a website that talks to the same database.
My problem is that when the application inserts or updates data it locks the table that it is updating.
This Causes request from the website to fail when searching for data in those tables.
The request from the website should take preferrence over everything.
So is there a way of configuring SQL to set priority to a particular transaction or to help solve this problem.
Or is there a way either in code or by configuring SQL so that the application only locks the record
that it is using and not the whole table.
thanks
What database are you using?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am using a SQL 2000 database.
SQL 2000 include a book online for you. Just open it and search for "transaction isolation level"
If the current state of your data really doesn't matter, you can try to use a locking hint in your query, like
SELECT * FROM table
WITH (NOLOCK)
WHERE ...
SELECT * FROM table
WITH (NOLOCK)
WHERE ...