Re: Locks and ADO
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Sat, 18 Nov 2006 09:42:41 -0500
Christian Schaeffler wrote:
Hello newsgroup!
Please let me quote a post I made to the SQL Server newsgroup. In
fact the ADO question fits better in here I think.
[quote]
We are using SQL Server as database for an application. Recently we
faced some deadlock errors and now I'm trying to understand what
happens... I already did the basic tracing with SQL Profiler and the DBCC
TRACEON
(3605,1205,-1) parameters and isolated some deadlocks with this
method. So my questions are more to the basics to learn how avoid
those problems. [...]
3. Since most of the queries we use are launched out of the source
code of our application, what would be the better (= safer) method?
Using the ADODB.Connection.Execute statement or openening a ADO
recordset and using ADO's integrated methods?
[/quote]
Any hints are welcome.
My preference is to use stored procedures. This is not a universal
preference by any means.
A lot of it depends on the type of application. I'm heavily in the ASP
world, so my goal is to get my database work done as quickly as possible:
get in, accomplish the task and get out. This means avoiding cursors,
especially for data maintenance. Since my intent is to minimize my
connection time, concurrency issues are minimized: yes they still exist, and
in some cases I need to write my stored procedures with concurrency issues
in mind (has te data changed since the it was retrieved by the current user,
etc.). But for the most part, I'm writing from the standpoint of "the last
editor wins".
OTOH, with a desktop application, where a user will typically stay connected
to the db for some period of time, perhaps retrieving a recordset and
working with it, it actually makes more sense to utilize the functionality
offered by the ADO cursor library to handle concurrency issues.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- References:
- Locks and ADO
- From: Christian Schaeffler
- Locks and ADO
- Prev by Date: Re: CursorLocation for Execute Method
- Next by Date: Re: ADO corrupts date time values in where clause
- Previous by thread: Locks and ADO
- Next by thread: Re: Locks and ADO
- Index(es):
Relevant Pages
|
|