Re: How to handle concurrency issue with better performance?



Would you put the timestamp check in the stored procedure on the server
side, or in the client side c# code?



"RobinS" <RobinS@xxxxxxxxxxxxxxx> wrote in message
news:gvCdnT3xivA-g5_bnZ2dnUVZ_qupnZ2d@xxxxxxxxxxxxxx
I use .Net 2.0 and VS2005, but I'm going to take a stab at answering your
question.

When you do the update on the dataset, it will only update the records
that have been modified since they were pulled from the database. So you
don't need to keep a separate table of those.

Instead of checking all of the fields for changes, what many people do is
store a timestamp in the database for the last update date/time. When
doing your update, you check to see if that value is the same, and if it
not, somebody else has updated the record since you pulled it. In this
way, you can have the WHERE clause on your update use the time stamp and
the primary key fields.

Hope this helps.
Robin S.
-----------------------------
"cherry" <cherryparadise001@xxxxxxxxx> wrote in message
news:1174529058.747242.168860@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am now thinking a method to handle the concurrency issue in my
program.
In .Net, the Command Builder Class will generate SQL automatically in
which it compares all the fields' original version with the version in
database as the update criteria and thus avoid overwriting others'
data.

In my case, I have a dataset retrieving data from joining several
tables and thus encounter error when use the DataSet.Update() method
of adapter directly.(cannot generate sql coz more 1 table in the
select command).
Therefore, I create stored procedure for the update command and assign
them to the dataset so that it can do the update. However, using the
concept of commandbuilder to handle concurrency issue, I have to
passing all the fields' original version to the stored procedure as
the where conditiion, the number of parameters might rise to about 30
to 40.
Will the preformance (esp. client) downgrade very much in using such
update method?

I was suggested by colleague to use 2 datasets, one is that I am using
right now and another will act as a image, storing the only table
which will be updated. So that when saving data to the database, I can
use the image DataSet's Update Command directly and needn't pass so
many parameters. But it seems that the synchonization between these 2
dataset is quite troublesome!

How you guys think? Which is better? or there is some better solution
which I may not know?
I am using VS.Net 2003 Enterprise to do the development, language is
VB .Net and the Database is Oracle 10g.
People using the application ~10-20, not a big number but the
performance of application must be as fast as possible due to the
business requirement.

Thanks in advanced.

Regards,
Cherry






.



Relevant Pages

  • Re: Recordsource only available to Administrator on clients
    ... Do your users have the right to access this second database? ... On the SBS machine as well as the clients, ... to temporarily set a client user's privileges from, ... parameterized stored procedure, ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Recordsource only available to Administrator on clients
    ... if in the ADP all database items appear ... are you able to double-click and execute the uspPT stored procedure from ... Server instance is readily connected via SSMSE (Server type: Database ... to temporarily set a client user's privileges from, ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Recordsource only available to Administrator on clients
    ... On the SBS machine as well as the clients, ... Server instance is readily connected via SSMSE (Server type: Database ... to temporarily set a client user's privileges from, ... parameterized stored procedure, ...
    (microsoft.public.access.adp.sqlserver)
  • Re: How to handle concurrency issue with better performance?
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... that have been modified since they were pulled from the database. ... select command). ... I create stored procedure for the update command and assign ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Application logic and Business logic
    ... but stored procedure languages is not. ... > was at least twice as slow as the original stored procedure. ... For the systems I've written it highly unlikely the back-end database ... It is far more likely the client application languages ...
    (comp.object)

Loading