Chad,

You should always var your query name and use a query name to make it
a local variable and avoid race conditions.

With that said, that is not the cause of your problem.

The deadlock is occurring at the database level.  Normally I can get
rid of deadlocks by tuning the query.  There are several ways to do
this.
1.  Get rid of columns not needed in select statements.
2.  Improve the query with a better where clause or less joins.
3.  Add indexes!  Your tables are probably not indexed properly for
the queries you are running.
4.  Run the queries that you are getting the deadlocks on through
Database Tuning Wizard / Advisor (SQL Server)
5.  If you just increased your server load a lot by adding customers
or an application, you may need to upgrade your SQL Server.  Look at
adding RAM or a faster processor.

Make sure that your primary keys have clustered indexes and your
foreign keys that you are joining on have non-clustered indexes.  It
is also good to create non-clustered indexes for items in your where
clauses.  Also, try to access resources in the same order.  If you
have two differerent pages that both use the Order Log and Order
tables, query them in the same order to avoid dead locks.

Hope this helps.
Thanks,
Ryan


On 10/1/07, gary gilbert <[EMAIL PROTECTED]> wrote:
> I don't believe so.
>
> You should check your lock type(s) you are using.  By default sql server
> uses row locking but you may be in a situation where page or table locking
> is taking place.
>
> Check out this
> http://www.sql-server-performance.com/tips/reducing_locks_p1.aspx for some
> good advice.
>
>
>
> --
> Gary Gilbert
> http://www.garyrgilbert.com/blog
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion 8 - Build next generation apps
today, with easy PDF and Ajax features - download now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289865
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to