[cfaussie] Re: cfinclude and parent document variables
Thanks everyone for the lively discussion! To try and test this issue I pulled all the code out of the includes into the parent and was still getting the same crap. I finally got a reply from HostMySite.com: This has to do with the MySQL server closing connections and CF not knowing about it. I have unchecked Maintain connections across client requests for your DSN as this will force CF to reconnect each time. While it does add a little overhead, its the only way to correct the problem you're having. Basically, because CF is caching its connection to the MySQL server, it thinks that there is an open connection, when in fact the MySQL server probably closed the connection. We need to keep our timeouts low on MySQL servers to prevent reaching max connection limits due to poor coding on some of our customers sites. This sounds like a crock of shit. This should be blowing all sorts of gaskets, not just missing variables. This is the strangest thing I've seen ColdFusion do in a long time and doesn't really explain it, but it did seem to solve the problem. Congrats on the move Scott! Missed you at WebDU this year, I didn't have anyone to watch Fin drink me under the table. PS: I'm looking for CF/Flex developers in Canberra again, so if anyone has some recommendations, please let me know. The projects will be many and varied and hopefully very interesting. Cheers David Heacock Internet Director ZOO Communications --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: cfinclude and parent document variables
I tried the same situation on my HostMySite.com account and it worked aok? either you're on a seperate box to me or somethings a miss in the code. I don't think Application scope is at play here as in theory if 4 people are on the box and 3 of them are constantly clearing the Application scope, the only way for it to affect all 4 is if they all share the same scopename? My memory is rusty but doesn't cfinclude distill down into the one class (or is that cfmodule)? could that be the faultline? On Thu, Jul 3, 2008 at 8:45 PM, [EMAIL PROTECTED] wrote: You would get this issue if head.cfm is included with cfmodule or as a tag instead of cfinclude. Except for a change in scope I'm not sure how this could happen. Blair On 7/3/08, David Heacock [EMAIL PROTECTED] wrote: I've got the strangest problem... I'm using a cheap CF hosting company HostMySite.com. I have a page that sets a simple variable: cfset product_name = Smood then includes a file that does some stuff: cfinclude template=/includes/head.cfm The strange thing is that head.cfm sometimes (not always, which is odd) can't see the variable 'product_name' in the parent document. Am I losing the plot or is this freaky? It's not that it gets the wrong variable (like with a caching problem), it just can't see it at all and throws a null pointer exception. Any ideas here? Cheers David Heacock -- Regards, Scott Barnes Rich Client Platform Manager Microsoft. http://blogs.msdn.com/msmossyblog --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: cfinclude and parent document variables
If you need to test it, wrap the cfouput of the var in a try and catch the error of use the isDefined() function. Also just output some non cf html or text in the head.cfm file to text if it is actually being called or not. Again you are using a local var so i dont see where the application scope is coming into play here. Is the product_name var being set within a condition? Maybe the condition is not being met and the var isnt being set. Also, might be just me, but setting vars in templates like that and expecting it is going to be in your other templates is a very bad idea. Steve _ From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Scott Barnes Sent: Saturday, 5 July 2008 7:37 PM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: cfinclude and parent document variables I tried the same situation on my HostMySite.com account and it worked aok? either you're on a seperate box to me or somethings a miss in the code. I don't think Application scope is at play here as in theory if 4 people are on the box and 3 of them are constantly clearing the Application scope, the only way for it to affect all 4 is if they all share the same scopename? My memory is rusty but doesn't cfinclude distill down into the one class (or is that cfmodule)? could that be the faultline? On Thu, Jul 3, 2008 at 8:45 PM, [EMAIL PROTECTED] wrote: You would get this issue if head.cfm is included with cfmodule or as a tag instead of cfinclude. Except for a change in scope I'm not sure how this could happen. Blair On 7/3/08, David Heacock [EMAIL PROTECTED] wrote: I've got the strangest problem... I'm using a cheap CF hosting company HostMySite.com. I have a page that sets a simple variable: cfset product_name = Smood then includes a file that does some stuff: cfinclude template=/includes/head.cfm The strange thing is that head.cfm sometimes (not always, which is odd) can't see the variable 'product_name' in the parent document. Am I losing the plot or is this freaky? It's not that it gets the wrong variable (like with a caching problem), it just can't see it at all and throws a null pointer exception. Any ideas here? Cheers David Heacock --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: cfinclude and parent document variables
Sounds pretty strange... though I had really weird issue with HostMySite.com as well. Not sure if this will help but might give you ideas... The application application.cfc extending another application.cfc which is pretty plain sailing. Though the my application scope was not setup correctly - which was really weird. After doing a cfdump I noticed that I had an array of Application scopes of other applications. This sent alarm bells off in my head. So what was the issue? The path to the extending application.cfc used a string that was also a mapping (Unknown to me). So the app was including an application.cfc from some random application. The mapping to this other application didn't even comply with HostMySite.com rules for CF mappings which really annoyed me. In the end I got in contact with HostMySite.com and informed them about this. I ended up just changed the path to my extending application.cfc and the app was running smoothly. This just shows you that an app which appears to be self contained can end up screwed. So maybe apply some radical thinking/debugging. cfinclude is a pretty simply so for it to behave as you're describing something else is up. David Heacock wrote: I've got the strangest problem... I'm using a cheap CF hosting company HostMySite.com. I have a page that sets a simple variable: cfset product_name = Smood then includes a file that does some stuff: cfinclude template=/includes/head.cfm The strange thing is that head.cfm sometimes (not always, which is odd) can't see the variable 'product_name' in the parent document. Am I losing the plot or is this freaky? It's not that it gets the wrong variable (like with a caching problem), it just can't see it at all and throws a null pointer exception. Any ideas here? Cheers David Heacock --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: cfinclude and parent document variables
ooh yeah, check your mappings as on a shared box it's a honour based approach really.. On Sun, Jul 6, 2008 at 8:18 AM, Ross [EMAIL PROTECTED] wrote: Sounds pretty strange... though I had really weird issue with HostMySite.com as well. Not sure if this will help but might give you ideas... The application application.cfc extending another application.cfc which is pretty plain sailing. Though the my application scope was not setup correctly - which was really weird. After doing a cfdump I noticed that I had an array of Application scopes of other applications. This sent alarm bells off in my head. So what was the issue? The path to the extending application.cfc used a string that was also a mapping (Unknown to me). So the app was including an application.cfc from some random application. The mapping to this other application didn't even comply with HostMySite.com rules for CF mappings which really annoyed me. In the end I got in contact with HostMySite.com and informed them about this. I ended up just changed the path to my extending application.cfc and the app was running smoothly. This just shows you that an app which appears to be self contained can end up screwed. So maybe apply some radical thinking/debugging. cfinclude is a pretty simply so for it to behave as you're describing something else is up. David Heacock wrote: I've got the strangest problem... I'm using a cheap CF hosting company HostMySite.com. I have a page that sets a simple variable: cfset product_name = Smood then includes a file that does some stuff: cfinclude template=/includes/head.cfm The strange thing is that head.cfm sometimes (not always, which is odd) can't see the variable 'product_name' in the parent document. Am I losing the plot or is this freaky? It's not that it gets the wrong variable (like with a caching problem), it just can't see it at all and throws a null pointer exception. Any ideas here? Cheers David Heacock -- Regards, Scott Barnes Rich Client Platform Manager Microsoft. http://blogs.msdn.com/msmossyblog --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: cfinclude and parent document variables
Sounds very strange. Things I note is that that you would normally get a coldfusion exception not a null pointer exception which is more at teh java level. The only times I have seen this occur is when 1. threading an application and a variable has been garbaged collected but the other thread thinks it still exists 2. ColFusion needs a restart cause it an old flaky 6.0 version and it has lost the plot 3. The application name is changed 4. templates get called out of order cause some didn't reaslise that template x relied on template y, etc. Maybe that gives some where to start anyway. Cheers, Simon On 03/07/2008, David Heacock [EMAIL PROTECTED] wrote: I've got the strangest problem... I'm using a cheap CF hosting company HostMySite.com. I have a page that sets a simple variable: cfset product_name = Smood then includes a file that does some stuff: cfinclude template=/includes/head.cfm The strange thing is that head.cfm sometimes (not always, which is odd) can't see the variable 'product_name' in the parent document. Am I losing the plot or is this freaky? It's not that it gets the wrong variable (like with a caching problem), it just can't see it at all and throws a null pointer exception. Any ideas here? Cheers David Heacock -- Cheers Simon Haddon Woman loves feeling danger and speed. That is why woman wants man. They get a speed rush that is the most dangerous of all. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: cfinclude and parent document variables
The only times I have seen this occur is when 3. The application name is changed [mad guess, inspired by above] how about there being a ton of websites on the same machine, it's either CF professional - or - enterprise not sandboxed correctly, and two applications having the same name? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: cfinclude and parent document variables
You would get this issue if head.cfm is included with cfmodule or as a tag instead of cfinclude. Except for a change in scope I'm not sure how this could happen. Blair On 7/3/08, David Heacock [EMAIL PROTECTED] wrote: I've got the strangest problem... I'm using a cheap CF hosting company HostMySite.com. I have a page that sets a simple variable: cfset product_name = Smood then includes a file that does some stuff: cfinclude template=/includes/head.cfm The strange thing is that head.cfm sometimes (not always, which is odd) can't see the variable 'product_name' in the parent document. Am I losing the plot or is this freaky? It's not that it gets the wrong variable (like with a caching problem), it just can't see it at all and throws a null pointer exception. Any ideas here? Cheers David Heacock --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---