By Peter Bell

Circular Dependencies and CF Dump

I was just testing out my circular dependency code in LightWire and it kept failing. I had wrapped LightWire with a simple test harness to do some testing which ended up by cf dumping an object so I could see the results. Everything worked great until I started testing circular dependencies and then I was getting 500 null Jrun errors. After fifteen minutes of increasingly desperate debugging a light turned on somewhere and I replaced the cfdump with another set of tests to make sure each service was available from the other. My dependence injection was working fine. It was CF Dump dying trying to create a nice representation of an infinite dependency loop. Just something to watch out for. It’s kind of obvious when you think about it, but I guess I just hadn’t thought it through!

Don't forget about the TOP attribute of CFDump... it's pretty snazzy!

Takes care of just this sort of thing. You can always set it much higher than needed and it still works fine.
# Posted By Ben Nadel | 10/8/06 8:12 PM
Hey Ben,

Been really enjoying your java posts recently - great stuff (despite the occasional dead end you ran into like the NewInstance() - same here with cfincluding all methods instead of extending).

Firstly, yu give me way too much credit with "don't forget about". It's something I never even knew about (it's CF7 only, btw). For some reason it doesn't seem to solve this particular problem. Not sure why, but dropped it in and I was still getting my jrun 500 null errors on two different machines when I put back in the circular dependency and the cfdump (but when I dropped the cfdump it worked fine). No doubt I'll figure out what is going on as time goes by.
# Posted By Peter Bell | 10/8/06 8:34 PM

I actually TOP attribute of CFMX 7 a few months ago. It's pretty awesome. It is sooo amazingly useful when you want to CDump out queries. In the case of queries (and I think arrays too) the TOP attribute limits the number of records that get displayed. A real page-rendering saver.

Also, I can't wait to see the code you just posted! I've been waiting since NY CFUG for this day ;) Unfortunately my computer time alotment for the day is over... gotta go spend time with the miss'us. But, I'm at my office at 7am and you better believe there will be some ZIP download action :)

Also, glad you enjoy the Java posts. I am kind of learning as I go. I really want to learn how to Compile Java. I thought I could do it in Eclipse... but I have never played well with Eclipse. There is a method for the CFQuery object, AddRowSetListner()... it takes an object that implements the RowSetListener interface. I have no idea what it does, but I am curious. I figure if I could only compile a Java class I could see... but alas, no idea how to do that.
# Posted By Ben Nadel | 10/8/06 8:49 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.005.