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