473,406 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Are transactional settings used only during updates?

Hi,

In the Web application I am working on, data is read from a SQL Server
database. At any time, there are about 15 people browsing the web.

The SQL Server database is updated with new information once every
hour. The update takes a couple of minutes. The isolation level during
the update is so to Serialazable so that the front-end does not get
any incorrect data.

Now, here is my problem. When the web page is being loaded, the server
side ASP.NET code uses several SELECT statements at multiple places.
For various design reasons, these SELECT statements cannot be combined
into a single statement. As a result, it may happen that during the
page load, we get some data before an update and some data after an
update.

I am wondering if I must used a transactional lock even for the Web
application although technically it is not updating the database.

Also, after playing with various transactional settings, I noticed the
following behavior for the readers when a writer enters a transaction:

1. If the reader app has not yet executed the query, the call to query
execution blocks until the writer has done its job.
2. If the reader app has already begun executing the query, the call
is not blocked and SQL Server provides the needed isolation.

I do not wish to block the readers while the update is going on.
Ideally, I would like it to be such that even if the writer is
updating, the readers must continue to get the old data, that is,
until the writer commits the update. However, I did not find any
isolation settings that would let me achieve this non-blocking
behavior. Am I missing something?

Thank you in advance for enlightening me.

Pradeep
Jul 20 '05 #1
1 1380
Pradeep (ip******@msn.com) writes:
The SQL Server database is updated with new information once every
hour. The update takes a couple of minutes. The isolation level during
the update is so to Serialazable so that the front-end does not get
any incorrect data.
The isolation level for the update process has nothing to do with
what happens at the front-end. What matters for the front-end is its
isolation level.
Now, here is my problem. When the web page is being loaded, the server
side ASP.NET code uses several SELECT statements at multiple places.
For various design reasons, these SELECT statements cannot be combined
into a single statement. As a result, it may happen that during the
page load, we get some data before an update and some data after an
update.

I am wondering if I must used a transactional lock even for the Web
application although technically it is not updating the database.
Yes, this is the place for serialiable isolation level. You start a
transaction, so if the update process chimes in while you are reading,
it will be blocked until you are completed and commit.

There is certainly all reason to be careful here. For instance, don't wait
for user input before you commit, because then the update process could
be blocked forever.
I do not wish to block the readers while the update is going on.
Ideally, I would like it to be such that even if the writer is
updating, the readers must continue to get the old data, that is,
until the writer commits the update. However, I did not find any
isolation settings that would let me achieve this non-blocking
behavior. Am I missing something?


This would be possible in Oracle today, and a new isolation level called
Snapshot isolation in the upcoming version of SQL Server, SQL 2005, also
makes this possible.

But now we are in SQL2000, and will have to do the best we can. I would
probably look into that update process. I don't know how much data that
is involved, but "a couple of minutes" for the update sounds a tad long
to me. I would not be surprised if that time can be significantly reduced.
Particularly the time for inserting data into the actual target tables.
If you need to clean up data, you can use staging tables, that are only
used by the update process.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: msuk | last post by:
All, I have a byte array that I save as a file to disk, is there anyway of saving the file as a transaction. For example I save the file to disk and virus scan it, if no virus is found I...
0
by: prashant | last post by:
Hi, I am doing transactional replication with queued updation from subscribers. I have synchronized database at both the ends. If I chose 'No I have data and schema at Subscriber' option while...
24
by: Ian Boyd | last post by:
i accidentally ran an UPDATE statement without the WHERE clause on a customer's live customers table. After saying "oh shit" many many times, i closed the ad-hoc query tool, hoping DB2 would see my...
2
by: Regnab | last post by:
I'm creating a database that will be used independently at different sites (in the same company). Given the fact that there will be inevitable changes down the track, I'm trying to work out the...
7
by: Paul | last post by:
I have a VB.NET 2005 program that I am running. It is transactional in nature and most of the steps are running a query against SQL Server tables. I have one executable that displays one form. ...
0
by: ceadtinneh | last post by:
First a bit about what I' trying to do. I'm running SQL Server 2005 Developer edition on my dev box. I've got two instances set up and am trying to set up transactional replication (with both...
3
by: Query Builder | last post by:
Hi All, I have a table with a column DeletedDate which stores a logical delete of a record. I need to set up transactional replication for reporting purposes that this deleted records should...
2
by: John | last post by:
Hi I need to store the path to db in my app. I have used app setting for this. Unfortunately various clients have different db paths and I have set them up once on each client location. The...
9
by: Michael Sparks | last post by:
Hi, I'm interested in writing a simple, minimalistic, non persistent (at this stage) software transactional memory (STM) module. The idea being it should be possible to write such a beast in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...
0
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...

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.