Static Data Functions

  • Thread starter Thread starter Nick P.
  • Start date Start date
N

Nick P.

We use a Class that contains all static data calls to retrieve and
update our SQL Server. the retrieval methods have been very fast, but
sometimes the update functions get Verrrrrrrrrrrrrrrrry slow. We use a
Mutex to synch the calls so that only one user at a time has access to
the data that is being updated, as well as transactions within the
calls. My question is this, should the update calls be instance
functions instead of Static Calls? Are we causing double bottlenecks
(Thread Block from the Mutex as well as the Table Locks from SQL
Server). This App will face some substantial traffic, so we are
looking to optimise at every level that we can.
Thanks for any insight on this matter.
Nick P.
 
Hi Nick,

If you construct a new connection object within every method there is no
need to synchronize anything.
Of course if you do not use other shared variables.
Maybe is better if you leave it to concurrency management - let the database
handle it
See the
Introduction to Data Concurrency in ADO.NET
..net help topic.
 
Back
Top