G'day
I'm doing this second post today to make up for the missed one y/day. Not that I imagine anyone's day was ruined by not having a new article to read on this blog, but anyway, here you go.
I've just run through the installation processes for ColdFusion 10 (Enterprise), Railo 3.3.4.003 (using the .exe installer), Railo 4.0.0.013 (the Jetty version), and OpenBD 2.0.2 (the Jetty version).
It was an "interesting" process.
Tuesday, 31 July 2012
CFCHART phones home
G'day
Sorry about the lack of post today (or yesterday, depending on your TZ)... I had some family dramas to deal with that needed to take precedence over my waffling.
This is just going to be a quick post too.
Stephen Walker put me onto this via Twitter, and all credit for noticing this goes to him.
Sorry about the lack of post today (or yesterday, depending on your TZ)... I had some family dramas to deal with that needed to take precedence over my waffling.
This is just going to be a quick post too.
Stephen Walker put me onto this via Twitter, and all credit for noticing this goes to him.
Sunday, 29 July 2012
Are CFINSERT and CFUPDATE as bad as everyone makes them out to be?
G'day
This is a bit of a lazy-Sunday sort of posting. I was on the Adobe forums last week, and CFINSERT and CFUPDATE came up in conversation. The person asking the question was asking about <cfqueryparam> and I responded to that (and cross referenced to my post on that topic, should you want to read it), but I mostly left the <cfinsert> and <cfupdate> side of things alone, sniffing with distain and moving on to something else.
I decided I didn't like leaving the question unanswered, so revisited it today.
I could recall a discussion a while back about these two tags not parameterising their values, which kinda invalidates them in my view. But I decided to find out where they're at now.
I found this bug that was raised on the old bug tracker which covers this topic, and the ticket is still open so it seemed like the problem still existed. However I never trust the Adobe bug tracker because... well... err... it's just not very good and not very accurate, so I decided to re-investigate for myself. I knocked together some quick code, thus:
This is a bit of a lazy-Sunday sort of posting. I was on the Adobe forums last week, and CFINSERT and CFUPDATE came up in conversation. The person asking the question was asking about <cfqueryparam> and I responded to that (and cross referenced to my post on that topic, should you want to read it), but I mostly left the <cfinsert> and <cfupdate> side of things alone, sniffing with distain and moving on to something else.
I decided I didn't like leaving the question unanswered, so revisited it today.
I could recall a discussion a while back about these two tags not parameterising their values, which kinda invalidates them in my view. But I decided to find out where they're at now.
I found this bug that was raised on the old bug tracker which covers this topic, and the ticket is still open so it seemed like the problem still existed. However I never trust the Adobe bug tracker because... well... err... it's just not very good and not very accurate, so I decided to re-investigate for myself. I knocked together some quick code, thus:
Saturday, 28 July 2012
Investigation into applicationStop()
G'day
This is a bit of a funny ("odd" as opposed to "amusing") one today, as I set out to investigate a hypothesis with preconceived expectations, but it turns out the expectations were wrong. But in a good way as it turns out.
A wee while ago - in the weeks leading up to ColdFusion 10's release - I was involved in a discussion about how applicationStop() works, and that it apparently had a moderately serious glitch in it that rendered it not production-ready.
What seemed to be happening was that as soon as applicationStop() was called, it did what it said on the tin: stopped the application. However it did this without any consideration of any requests which might still be running, and they'd possibly error if suddenly the application scope vanished. This could be a risk because applicationStop() only stops the application: it doesn't start it again... It relies on the next incoming request to trigger this. However an already-running request will - in the meantime - not have an application!
I'm an fairly certain I tested this on CF9.0.1 and the beta of CF10, and these concerns were borne-out.
This morning I wrote some test code to demonstrate this to you, and go "oh dear... that's not good, is it?".
This is a bit of a funny ("odd" as opposed to "amusing") one today, as I set out to investigate a hypothesis with preconceived expectations, but it turns out the expectations were wrong. But in a good way as it turns out.
A wee while ago - in the weeks leading up to ColdFusion 10's release - I was involved in a discussion about how applicationStop() works, and that it apparently had a moderately serious glitch in it that rendered it not production-ready.
What seemed to be happening was that as soon as applicationStop() was called, it did what it said on the tin: stopped the application. However it did this without any consideration of any requests which might still be running, and they'd possibly error if suddenly the application scope vanished. This could be a risk because applicationStop() only stops the application: it doesn't start it again... It relies on the next incoming request to trigger this. However an already-running request will - in the meantime - not have an application!
I'm an fairly certain I tested this on CF9.0.1 and the beta of CF10, and these concerns were borne-out.
This morning I wrote some test code to demonstrate this to you, and go "oh dear... that's not good, is it?".
Labels:
CFML,
Code Examples,
Dave McGuigan
Friday, 27 July 2012
How do I know if this variable is a file handle?
G'day
I'm not going to make a habit of making two posts in one day, but this quandary has just presented itself, so I'm gonna ask about it on StackOverflow, the Adobe forums, and Twitter (via this post).
I have this code:
This is a version of the code from my earlier post, having been fixed slightly as per Simon Baynes's observation that I had a spurious catch() block in the original.
Anyway, there's another bug in it: if there was an error during the fileOpen(), then the file variable won't be a file handle, so the fileClose() in the finally block will error. Oops.
So I need to identify whether the file variable is actually a file handle, and iff it is, then close it.
I'm not going to make a habit of making two posts in one day, but this quandary has just presented itself, so I'm gonna ask about it on StackOverflow, the Adobe forums, and Twitter (via this post).
I have this code:
This is a version of the code from my earlier post, having been fixed slightly as per Simon Baynes's observation that I had a spurious catch() block in the original.
Anyway, there's another bug in it: if there was an error during the fileOpen(), then the file variable won't be a file handle, so the fileClose() in the finally block will error. Oops.
So I need to identify whether the file variable is actually a file handle, and iff it is, then close it.
Labels:
CFML,
StackOverflow
Why do CFML arrays start at 1 instead of 0?
G'day
A few weeks ago whilst investigating something completely unrelated, I came across an interesting thread on StackOverflow, in which someone had asked why ColdFusion arrays start at index 1 rather than index 0 like other languages do.
This was an old thread, but my thoughts on it were a bit different from the others thusfar offered, so I wrote up my own point of view. Whilst writing it I started to think "I wish I had a blog for this sort of thing, rather than posting it on an old thread on StackOverflow"... and it was that thought that culminated in me finally starting this blog.
Anyway, I realise it's a bit of a duplication, but I'm "reclaiming" the post for myself. Here it is.
A few weeks ago whilst investigating something completely unrelated, I came across an interesting thread on StackOverflow, in which someone had asked why ColdFusion arrays start at index 1 rather than index 0 like other languages do.
This was an old thread, but my thoughts on it were a bit different from the others thusfar offered, so I wrote up my own point of view. Whilst writing it I started to think "I wish I had a blog for this sort of thing, rather than posting it on an old thread on StackOverflow"... and it was that thought that culminated in me finally starting this blog.
Anyway, I realise it's a bit of a duplication, but I'm "reclaiming" the post for myself. Here it is.
Labels:
Arrays,
CFML,
Courting Controversy,
Theory
Thursday, 26 July 2012
Finally
G'day... This is another one of those "Adam admits he's a bit thick, and doesn't RTFM" kind of posts.
Yesterday I was writing a function which loaded and read from a file, and extracted some info from it. It's entirely legit for the thing being sought to not be in the file, and the correct response in this case is to return an empty string. I wanted to deal with the chance of the file ops failing, so I wrapped the whole thing in a try/catch/finally as one is wont to do. I'll stop describing the code and just list it:
Can you see the stupid thing I've done here?
It seems straight fwd: I look for the value I'm after, return it if I find it, or if I get to the end of the file I return an empty string. If I encounter any problems, I just error, but make sure I close the file.
Except it doesn't work... I always got an empty string. The matching & extraction logic is fine (I checked): it just wasn't working.
Yesterday I was writing a function which loaded and read from a file, and extracted some info from it. It's entirely legit for the thing being sought to not be in the file, and the correct response in this case is to return an empty string. I wanted to deal with the chance of the file ops failing, so I wrapped the whole thing in a try/catch/finally as one is wont to do. I'll stop describing the code and just list it:
Can you see the stupid thing I've done here?
It seems straight fwd: I look for the value I'm after, return it if I find it, or if I get to the end of the file I return an empty string. If I encounter any problems, I just error, but make sure I close the file.
Except it doesn't work... I always got an empty string. The matching & extraction logic is fine (I checked): it just wasn't working.
Labels:
CFML,
Code Examples
Subscribe to:
Posts (Atom)