Recent Posts

Mar 23 2010

Installing CF Builder as a Plugin on a Mac? Watch out for this...

After getting odd non-code highlighting issues, mylyn issues etc...

I happened upon this - http://blogs.adobe.com/cfbuilder/2010/03/things_to_watch_out_while_inst.html

The key line is "For Mac OSX, cocoa version of eclipse is not supported.Make sure that you use carbon version of eclipse."

made all the dfference for me.

2 comments - Posted by Jonathan at 1:03 PM - Categories: CFBuilder | ColdFusion

Feb 22 2010

The Best Bad Code Eva!

Not sure if I could find a worse way to accomplish this...

On the page we have:

<cfset my_date = mycomponent.ConvertStringToDate(stringDate = form.this_date)>

And the cfc it is calling has this method:

<cffunction name="ConvertStringToDate" access="public" output="false" returntype="any">
    <cfargument name="stringDate" type="string" required="true" hint="send id to return single item">
    <cfquery name="getDate" datasource="#mydsn#">
        Select to_date('#arguments.stringDate#', 'mm/yyyy') as newDate
        from dual  
    </cfquery>
    <cfreturn qDate.newDate>
</cffunction>   

The CFC is not even a "utility" component or such. It is something like a "user" object.

I LOVE IT!

I have made all variables generic to protect the guilty.

3 comments - Posted by Jonathan at 8:47 AM - Categories: ColdFusion | Oracle | SQL | Software | Stupidhead

Feb 19 2010

Caveat about (I just waisted 2 hours of my life because of that tag)

Here is how my day has gone so far

I am debugging an issue with a application view that is killing my local server.

I am calling a get() method from a component and the server hangs, never to return.

WOW! That must be a nasty query. Yes, Yes it is.

Well, slightly nasty. I got my queryparams in place, so that's not the issue. Actually,  not that nasty at all. Several sizable tables (i have select * for tables - i know, i Know, bad practice. but this is 4 year old code)

Hmm... maybe I am missing something.

Let's go talk to the dba and have her fire up their monitoring. Almost no activity coming from the Coldfusion Server.

Hmmm... (again).

Run the query directly against the database? OK, response is immediate.

Fire up CF Server Monitor.

How! Request is super slow but the memory usage is through the roof! 700MB

Does lots of queryparams (espesially used with list and WHERE IN cluases) cause memory useage?

Google...

Nothing.

Try to simplify query, just to test...

Still timesout.

What?

What is this that I see?

<cfdump var="#queryResult#">

right before the <cfreturn queryResult>

Ooooooohhhhhhhhhh!!!

I must have thrown that in once for debugging but just switched the Output attribute of the function to "false" and left that cfdump tag in.

In most cases, that's not a problem or at least not noticable. But this query (being slightly nasty as I stated earlier and containing select *) contained a lot lot lot of data, and in some cases, returns a bunch of rows.

So leason learned

Apparently, throwing debuging info into a component's method and then turning off output does indeed keep it form being outputted to the page, BUT it does not prevent it from actually being generated.

In this case it was a very large record set and so the cfdump output was huge.

I am still not sure why it caused THIS MANY problems. I have dumped huge objects onto a page and, while slow, did not just Kapowee the server.

But from now on I am going to be a little more deciplined in how and when I dump debugging info within CFCs

1 comments - Posted by Jonathan at 7:27 AM - Categories: Oracle | ColdFusion | Debugging | Performance | General | Stupidhead | SQL

Previous Posts

Jan 27
Jan 5
Dec 14
Dec 10

Subscribe

Categories

Monthly Archives

Search Archives

Favorite Links

My Links

Coldfusion Links

Recent Tweets