469,609 Members | 1,682 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Locking Hints

tim
I am really new to ASP.NET and I was wondering if most developers use
locking hints when accessing the data in SQL Server. What kind of
multi-user issues come up when using an ASP.NET application?

May 12 '07 #1
2 1226
On May 12, 5:45 pm, t...@it-workforce.com wrote:
I am really new to ASP.NET and I was wondering if most developers use
locking hints when accessing the data in SQL Server. What kind of
multi-user issues come up when using an ASP.NET application?
In most cases, I think, the problem will be in the database design.
However, some ASP.NET "related" things, like leaking connections,
round-trips and server controls may cause a bottleneck. A server
controls can be a problem in some situations, e.g. the DataGrid
minimises the development, but its paging function requires all of the
data to be bound.

May 12 '07 #2
In general, there are "multi-user issues and considerations" when
using ASP.Net.... and there are "multi-user issues and considerations"
when using SQL Server. ASP.Net and SQL Server are two different
products and you need to consider multi-user issues for each.

SQL Sever:

- Usually don't need to use locking hints. In general not
recommended. If it turns out that you do diagnose and discover that
you do have "bottlenecks" or "deadlocks" then you might start using
locking hint to help resolve them. For really common read-only
queries, I do sometimes like to issue the "(with nolock)" statement to
ignore locks and just return the data.

- The main multi-user issue you have is that you need to decide the
business rules of how you want to handle the situation when two people
try to update the same record. Is it okay that the last one wins?
What if: Person 1 reads a record, then Person 2 reads and updates
that record, then Person 1 finally updates the record. Changes from
Person 2 are blown away. Is that okay? Sometimes yes, sometimes no.
Depends on the business logic.
ASP.Net:

Types of multi-user issues here are when using shared memory such as
global state variables stored in the "application object" or "cache
object" or "session object". Make sure one thread is not updating
while another thread is reading. Better: make sure each variable is
accessed by only one thread at a time. This can be a real problem
when using session variables in conjunction with multiple AJAX
threads.

A different type of multi-user issue is when you put multiple
instances of the same "User Control" on one page. Make sure they can
co-exist and that all variables are uniquely identified.

Hope that helps.


May 13 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Geoffrey | last post: by
3 posts views Thread by heynothanks | last post: by
16 posts views Thread by Nid | last post: by
5 posts views Thread by DraguVaso | last post: by
2 posts views Thread by Daniel Diehl | last post: by
1 post views Thread by bjornsuneandersen | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.