PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Re: newbie questions about dataset

Reply

Re: newbie questions about dataset

 
Thread Tools Rate Thread
Old 29-06-2003, 03:37 AM   #1
Kathleen Dollard
Guest
 
Posts: n/a
Default Re: newbie questions about dataset


If you are using a database that supports transactions, you can potentially
stay connected and maintain a transaction to behave as a lock. There are
many scenarios where this would not be a good idea.

ADO.NET just doesn't support what you are trying to do. You might consider
using ADO classic in .NET via interop. That can be slow so you will probably
want to create a wrapper in COM (like VB6) to avoid chatty interop
conversations.

Other than that, ask yourself why it is really so bad for the 2nd (or 3rd)
person to have to resolve the conflict. The core of your resolution probably
resides there. If you truly need users 2 and 3 to know that user 1 is in the
record, you will want your own semaphore locking system. Relatively easy to
write the basics, just tough to get the timeouts correct. If you have
transactional problems, reconsider your transaction design. If you can't
communicate back to users 2 and 3, then they have no way to know if their
work is lost in other situations either.

Since you think this is important, have you considered writing up the
business scenario where you think pessimistic locking is critical and send
it to Microsoft's wish list?

Kathleen


"SStory" <NOSPAMShane_Story@msn.com> wrote in message
news:#DQiczPPDHA.3768@tk2msftngp13.phx.gbl...
> Thanks Group for all of the responses, they are most enlightening. I have

a
> potential upcoming project to do in .NET and need to know more about this
> issue.
>
> So, assume that user 1 connects and get a dataset, plays with it and makes
> changes.. User 2 and 3 do likewise.
>
> When they reconnect to reconcile,
> I should go through each record comparing original data to new data and
> complain if the times are different.
>
> The moral of the story being that for important transactions it is better

to
> use a connected recordset and use the disconnected only for querying and
> such?? Is that pretty much true?
>
> If so, please tell me how you do a connected recordset in ADO.NET?
>
> thanks a lot
>
> "Jay Pondy" <jpondy.news.invalid@web2news.net> wrote in message
> news:45198N113@web2news.com...
> > Just prior to making your update to the database you need to verify that
> > the database fields still contain the same data that you originally
> > pulled from them. If they don't they someone else has updated them.
> > One simple way to do this with a single field in SQL Server is to use
> > the TimeStamp type on a field that will be used for this purpose.
> >
> > SStory wrote:
> > > If that is the case then what are datasets good for?
> > > If I and 10 other people make changes, not know what the
> > > other 10 did, and
> > > only the last persons changes are reflected, it appears to
> > > me that it is an
> > > unreliable system.
> > >
> > > Is there no way to use datasets and somehow sync the data,
> > > or are they just
> > > for readonly queries? Or am I to assume the people using
> > > datasets expect
> > > only one user to use them and update at a time--not likely.
> > >
> > > I still don't understand and believe there must be
> > > something that I am not
> > > seeing in using disconnected datasets.
> > >
> > > Thanks
> > >
> > > "SStory" <NOSPAMShane_Story@msn.com> wrote in message
> > > news:uL0Ywr1NDHA.3768@tk2msftngp13.phx.gbl...
> > >> QUESTION 1
> > >> I understand that a dataset is an in memory
> > >> representation of tables,
> > >> relations, etc.
> > >> Supposing I have multiuser app with one database. Each
> > >> user, using my
> > > app,
> > >> gets a dataset of the information and disconnects from
> > >> the DB. They make
> > >> changes based on the information at hand and reconnect to
> > >> reconcile, but
> > > so
> > >> did 10 other people.
> > >>
> > >> How is it that if I make changes based upon information
> > >> and someone else
> > >> does the same, how does the correct updated value get
> > >> into the database?
> > >>
> > >> Say 3 people see we have 10 of product in stock and need
> > >> to order more.
> > > All
> > >> three looking at a disconnected dataset as I understand
> > >> it--order 50 more
> > >> items. will there be 150 items ordered? How is this avoided in the
> > > dataset
> > >> strategy?
> > >>
> > >> QUESTION #2
> > >> If too much information is placed in the dataset--more
> > >> than memory can
> > >> handle, does it cache/swap to disk (i.e. part in memory
> > >> and the overflow
> > > in
> > >> an XML file) ?
> > >>
> > >> I am trying to get a grasp on various concepts in order to make some
> > >> application and understand implications of my choices.
> > >>
> > >> Thanks in advance,
> > >>
> > >> Shane

> >
> > --
> > Direct access to this group with http://web2news.com
> > http://web2news.com/?microsoft.publ...ramework.adonet

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off