problem in multiuse with asp.net

  • Thread starter Thread starter Deep Silent Ocean
  • Start date Start date
D

Deep Silent Ocean

Hi All

I am developing one Portfolio Management application where there is
single database shared by all the traders.

I have developed web-based application for this. I want to make this
multiuser application.

Following is the architecture of the application ...

Front End is developed in WebForms

Business Layerm : Represented by one Object
Database Layer : Represented by one Object
and Actual Database : SQL Server


Now, when I open two browser window and open Main-Entry form in both the
windows.


Now, when I deleted one transaction in one window and it gets updated in
database and that page gets refreshed and shows updated data.


now, in the second browser-window still there is stale data, now when i
select the same transactions which i deleted in the first window it
throws me error. it says that row is no longer there. That means DataSet
is shared by both the pages.

How, can I avoid that so that every opening of new windows gets its own
dataset ? or some log-in mechanisam which creates different session for
every user ...


I want to seperate out the user from each other so that individual user
can work on its own set of dataset ..


My Business Logic Layer and DbLogic Layer are seperate projects. Both
the layers are represented by one Object which i get from Factory pattern...

Following is the object creation sequence :

So invocation of Entry-Main Form.aspx creates one business object - >
business object inturn create dbutil object - > db util has dataset
within it which stores data coming out from stored procedure ...


Silent Ocean ...
 
First, your method of testing can very well cause you to share session,
unless you are using two different types of browsers. But, that is not the
problem here. Leet's examine:

Broswer one requests data
Browser two requests data

At this point in time, should browser two have the exact same data as
browser one? The answer is yes.

Browser one deletes data and saves

Does browser two still have the same data it requested? Yes. Only browser
one has new data (not showing the deleted record).

Browser two edits the same data

Is this the same DataSet as browser one? Obviously not, as the record has
been deleted. They are not sharing data. But, browser two trying to edit a
deleted record causes an obvious problem.

What you are dealing with is an issue called concurrency. This is not an
issue unique to .NET, although the disconnected nature of ADO.NET certainly
exacerbates the issue.

In ASP.NET 1.x, your only real solution is to capture concurrency problems
and alert the user. Look up Dino Espositos articles on ADO.NET
(msdn.microsoft.com), as some of them cover concurrency. His book on ASP.NET
1.1 and ADO.NET is also quite good on this issue.

In ASP.NET 2.0, you have the ability to add in concurrency protection, of
sorts, by having alerts sent when the data in a DataSet changes. This
functionality works best with SQL Server 2005.


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Back
Top