Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Track down the bad lock 1

Status
Not open for further replies.

yippiekyyay

Programmer
Oct 26, 2002
186
CA
Hello,

I've been getting a lot of errors on my site lately that seems to relate to CFLOCK. As the pages throw errors, I comment out the offending locks and then things run smoothly. Of course this is not a good solution because I also had to comment out a couple of custom tag calls (because they use CFLOCK in them) which I need to have running and I know work because they have for years and other sites continue to use them without problems.

The other curious thing about this situation is the consistency. Every morning for over a week now I've come in and seen that my site was throwing the error. I comment out the locks and everything goes back running slick as ever. After a couple of hours, I later take out the comments (putting the cflocks back in the code) and everything continues to work fine. Until the next morning, where all this repeats... ???

One of my colleagues has a theory that I've accidentally created a deadlock somewhere which does sound like a good explanation but I'm not sure how to go about tracking that down. I was wondering if anyone had any debugging tips for me to track down the problem or has run into something similar ...?

Thanks in advance!
 
hi yippiekyyay,

I have some questions that could better help us help you in tracking down your issue:
Could you provide an example of one of the offending locks?
Does the problem seem to stem from the same locks everytime?
Could you post one of the errors thrown?
Are all of your references to shared variables placed within locks?

I had a similar run in with locking issues at work, but it was attributed to not having all of our shared variable 'sets' and 'gets' being locked.

jalpino
 
Hi Jalpino and please excuse my late reply! We had a very busy couple of weeks and to resolve the issue I was forced to remove lots of code so that the error wouldn't occur.

The error I would get was this:
Error Diagnostic Information
Timed out while waiting to obtain exclusive access
The error occurred while processing an element with a general identifier of (CFLOCK), occupying document position (149:1) to (149:58).

The timeout was set to 5 minutes and it would only take 2 seconds to come up with this error message so something else is going on there I think. (this answers both your 1rst and 3rd questions right?)

Yes, the problem would always start at the same lock and I would keep commenting them out until I got no errors - i.e. once I commented one out, the same error was thrown on a different so I'd comment that one out, and so on (I'm pretty sure that it was the same ones each time).

As for your last question, I'll need to get back to you but my feeling is that I doubt it.

Thanks alot for helping!
 
What database are you using on the back-end?

Some databases store records in "blocks" of data, and the lock can actually occur because too many users are accessing the same "block". Oracle, for example, has some parameters that govern how many users can be altering the contents of a block at the same time.


David Wendelken
 
Why not wrap the CFLOCK tags inside CFTRY/CFCATCH and then CFDUMP the CFCATCH along with anything else that might help debug the issue. Email yourself that piece of information so you knoW the exact time/date of the error.

Another good thing about using CFTRY/CFCATCH is that if the piece inside CFTRY/CFCATCH fails your site won't. Well, that is unless you decalre anything inside the CFTRY/CFCATCH that gets referenced somewhere else. If that is the case you need to go everywhere the variables maybe used and wrap them with <cfif isdefined("varname")></cfif>

Does that make sense??


____________________________________
Just Imagine.
 
Hi again everyone,

The cftry/cfcatch does make sense and is an excellent idea but I have one small problem - one of the errors seems to stem from a custom tag that I must use and I cannot edit. (I have edited out this code for the past week and everything has been running smoothly since - but I have to re-implement it soon). I will try to work this in though!

David - I know that the majority if not all of the site is on SQL Server 2000. The reason why I can't be positive is because of the paragraph above - a custom tag that I don't know much about (there is a good possibility that it still uses an Access 2000 db! - I will try to find out).

Thanks again everyone!

-Sean
 
Sorry, I don't know the parameters (if any!) to adjust for either of those databases. Oracle I could help you with.

Can an Access database actually be used in a multi-user mode? Enquiring minds want to know!

David Wendelken
 
What custom tag are you using? What is the purpose of that custom tag? Can you post it so we can help recode it if necessary.


____________________________________
Just Imagine.
 
Just found out that it does use an SQL Server Database - but it did at one time use Access (for those enquiring minds out there) :)

GUJUm0deL - that is nice of you to offer but unfortunately I don't have access to the tag in question (it's like I'm going to take credit for it if I get my hands on it or something).

I've tried implementing your previous solution but I must be doing something wrong. The tag does not run (which is better than the site failing), but I do not get the email message either. Here's what I tried:
<cftry>
<cfmodule template="/path/stupidcustomtag.cfm" param=#param#>
<cfcatch type="ANY">
<cfmail to="me@me.com" from="donotreply@me.com" subject="Error" type="HTML">
Error
</cfmail>
</cfcatch>
</cftry>

The param is a struct which I've asked them to verify and they've assured me that all is well (hasn't change in years). It's used to do our side navigation buttons.

Thanks again!
 
I'm always in favor of using code you know. If i use code i didn't write i want to be able to see/modify it if needed. If i can't. I'll figure out how to write it myself.

you may have better results making a simple included file with the nav. Forget the tag all together.

Technology is dominated by two types of people: those who understand what they do not manage, and those who manage what they do not understand. - Putt's Law
 
yippiekyyay, hmmmm since you can't post the custom tag can you tell us what it does?? Maybe that might help figure out what cf functions or cfscript it may be using.

As for the <CFTY><CATCH> you're using it right. If you don't get the email it can be one of 2 things:
1) the mail server isn't set up right. If that is the case, use an email address that you know is setup right.
2) the tag didn't even run, and if it didn't run then it didn't fail. If that is the case then maybe everytime your site crashes the tag is run, and when it doesn't run the site works fine.

All in all, you need to look at the custom tag and see if you need to tweak something to make it work. There really is no other way of knowing if the tag is the actual culprit or something referencing the tag is the culprit.




____________________________________
Just Imagine.
 
Guju...
yippiekyyay said:
The param is a struct which I've asked them to verify and they've assured me that all is well (hasn't change in years). It's used to do our side navigation buttons.

hence my post using a cfinclude, many people use <cfinclude template = "menu/nav/sidebar/whatever.cfm">

Technology is dominated by two types of people: those who understand what they do not manage, and those who manage what they do not understand. - Putt's Law
 
Well, to add further confusion to the mix, it turns out that there was also something wrong with the server (I'd upload the page but it wouldn't overwrite the existing one - hence my post above about not noticing any difference and the code not running - turns out the previous version where I had blocked out the code was still there).

Now that it has been properly uploaded, the site is working and I have received one email notifying me that the cftry caught an error (I assume it will just not display the navigation buttons for that user who triggered it). The best news of all though is the fact that the site is currently running smoothly!

I think I can take it from here (by passing more information in the error email), thank you all very much for the help!

Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top