Thanks for the replys.  It is useful as is this page:

http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001169.htm

I now don't believe I had a deadlock issue.  So according to Adobe and
others when throwontimeout is NO, if the timeout is reached, processing
continues after </cflock> instead of pulling up errors and this would
account for the lack of data stored in the database.   I read this on
Adobe.com:  *"never use the throwOnTimeout attribute for CFMLthat must run.*"
I would rather use
cftry<http://livedocs.adobe.com/coldfusion/7/htmldocs/00000349.htm#1104557>and
cfcatch<http://livedocs.adobe.com/coldfusion/7/htmldocs/00000225.htm#3395038>and
stop the lock from essentially being by-passed in the first place as
it's vital for that process to be ran.

I am unsure exactly why the timeout was reached in the first place, but as I
have simplified the lock (no use of querys inside the lock) I think that
this would speed things up quite a lot. Even though I can't copy all my code
in here, I can confirm that other locks above my problem area had ran and
inserted stuff correctly to DBs even when my problem code had not and this
code was a very simple snippet of code indeed so I guess it ran fast and did
not timeout.  Adobe suggest to use the minimum amount of code as possible in
locks.

Thanks for your comments

Andrew


2008/10/2 James Holmes <[EMAIL PROTECTED]>

> Can you just use createUUID() to generate a unique ID without needing a
> lock?
> Regardless, you shouldn't be seeing a deadlock unless there's a whole lot
> more to the code than that which you posted; even then the timeout should
> be
> observed and you shouldn't be getting an infinite deadlock.
>
> http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_j-l_05.html
>
> mxAjax / CFAjax docs and other useful articles:
> http://www.bifrost.com.au/blog/
>
>
> 2008/10/2 Andrew Mason <[EMAIL PROTECTED]>
>
> > Hi Folks,
> >
> > I wonder if someone can help me.
> >
> > I have a situation where I use cflock when generating IDs to ensure no
> > duplications occur etc which 'sometimes' results in a deadlock situation.
> >
> > <cflock timeout="8" throwontimeout="No" name="LockName" type="EXCLUSIVE">
> > <cfset ID=..........>
> > </cflock>
> > <Insert Query Here>
> >
> > Because the Throw is 'no' whenever the lock gets 'stuck' for whatever
> > reason (which is quite rare, but has a high impact negative outcome) the
> > timeout is ignored and then it carries on forever, or atleast until I
> > restart my webserver.  It is important to keep the Throw set to No.  Does
> > anybody have any suggestions as to what to do to break this vicious
> circle
> > of locking without any manual intevention?
> >
> > The code above is actually an improved snippet than my earlier version
> > because I had previously included a select query and an insert query
> inside
> > the same bounding CFLOCK by the way.  This may have been the root cause
> of
> > my problems because there was more work required in the original lock
> code,
> > but I don't really understand cflocks enough to be sure.
> >
> > Maybe I could use an server monitor software to analyse a test CF page
> > which tries to run a lock with the same name and then runs some sort of
> > action to restart on it's own as a last resort?
> >
> > Thanks a lot
> >
> > Andrew
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313403
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to