473,687 Members | 3,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1356
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 "bottleneck s" 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 "applicatio n 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1809
by: Geoffrey | last post by:
We have developed a python class that can read data files created from another application. These target files are C-ISAM files used for accounting applications so the "primary" application may be reading and/or writing to portions of the files ("records") at the same time. The python class we developed opens the requested file in 'rb' mode, reads the file header (first 512k) and using information supplied in the file header (such as...
0
1503
by: Dave C. | last post by:
Hi there, We have some code that empties a table. Originally, the code used "delete from", but I am told that this method was either too slow, or held a lock for too long (this was a long time ago and I wasn't involved at that point, so I'm not 100% sure exactly the nature of this problem). So the code was changed to "truncate table". Now however, this table is being replicated, so truncate table is no longer an option. I need to change...
3
2612
by: heynothanks | last post by:
(MSSQL2000) I have read the transaction/locking sections in the MS-help, online and several books. What I want to understand is the transaction behavior in single statements . If I have a Table: "Letters" with 1 column "L" and the table presently has rows{A,B,C,D} Case 1 (Insert): First start transaction T1 "SELECT * FROM Letters" Next start transaction T2 "INSERT INTO Letters
16
8922
by: Nid | last post by:
How do I do row-level locking on SQL Server? Thanks, Nid
5
1423
by: DraguVaso | last post by:
Hi, My VB.NET-application has to do some actions on a SQL Server Database, but during these actions the DataBase may not be used by any other application. the total time of the lock could be up to 15 minutes. How can I perform something like a lock, who denies other users/applications to access the Database, and after a while grant themagain permission. Thanks,
9
1709
by: Lauren Wilson | last post by:
Hi Folks, We've been using Crypto ++32 to control licensed access to our widely distributed Access 2K app. Unfortunately, Sampson Multimedia appears to be out of business. Does anyone out there have recommendations for an alternate method of locking our MDE files to allow only licensed access? We simply want to allow the user to install the program and get a
2
3102
by: Daniel Diehl | last post by:
Good morning C# world, I have developed an USB Authentication-Software wich wants to lock the screen when the USB stick is unplugged and reactivate the desktop on USB Plug. Now I am sitting on the locking problem. I think there a two possible ways to do this. a) Disabling ALT-TAB, ALT-F4 etc. b) Locking the screen for everything
2
1611
by: Nick | last post by:
We have recently discovered that on our production environment certain aspx files, two to be certain, are displaying a behaviour we understand ought not to be possible under the (ASP).Net Framework. The read/write lock on the session object set by one request is being relinquished to a second request BEFORE the first request has ended. You can imagine the myriad of ugly situations that can arise from simultaneous requests concurrently...
1
1315
by: bjornsuneandersen | last post by:
I have a Stored Procedure that performs a simple SELECT. The Select have no locking hints or other hints and the database is set up in a standard configuration. The problem is that the SELECT runs for some time and while it is running I can see (in the profiler) that other SPs with simple SELECTs are held waiting until "my" SP has finished. The other SPs may be other instances of the same SP as the one I'm running. All SPs contains...
0
8590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8524
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9066
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8779
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8783
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6450
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4541
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2960
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.