469,616 Members | 2,559 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Thread Safety, dataset and dataview, ASP.NET

I according to MSDN dataview and dataset are thread safe for read
operations, but we run into this scenario. I just would like to see some
comments on it.
Aplication written in VB.NET it is an ASP.NET app.
located on busy web server.

Initially we defined dataview slightly wrong and run into the problem.

we have dataset cached which has large ammount of data.
sub Page_Load()
DisplayMyData()
end sub

Private sub DisplayMyData()
Dim ds as dataset=cache("Mydataset")

'this declaration caused a problem
dim dv as dataview=ds.tables("Mytable").defaultView

dv.rowfilter="My expression"

mydatagrid.datasourse=dv
mydatagrid.databind()
end Sub

ok, now during busy hours we had instead of several items, whole table
binded to datagrid. on refresh it was gone and everything worked fine.

problem was fixed when dataview was defind like this
dim dv as new dataview(ds.tables("Mytable"))
I understend why sometime we had whole table binded to datagrid, probably
when I tried bind dataview to datagrid, someone called that page and
dataview was changed to table.defaultview.

How this can be? dataview is not shared, sub is private
dataset is a shared object. Each user should have its own dataview and
reference to dataset.
Jul 21 '05 #1
1 4326
Arthur Dzhelali <a.********@theday.com> wrote:

<snip>
How this can be? dataview is not shared, sub is private
dataset is a shared object. Each user should have its own dataview and
reference to dataset.
No, everyone would be sharing the same DataView because they're all
using the default one for the table in the line:
dim dv as dataview=ds.tables("Mytable").defaultView

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Alex Ayzin | last post: by
4 posts views Thread by suzy | last post: by
2 posts views Thread by Dennis | last post: by
3 posts views Thread by Freeon | last post: by
1 post views Thread by Arthur Dzhelali | last post: by
1 post views Thread by rn5a | last post: by
11 posts views Thread by Sid Price | 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.