How to setup the CFEclipse Scribble Pad

I have been under the impression that everyone using CFEclipse was fully aware of the Scribble Pad, but after discussions with a few people this past week, I found that a number of people had no idea it existed.

In case you have no idea what I am talking about, the Scribble Pad is a very cool little tool built into CFEclipse that allows you to test code without it being part of any other project or without having to create some ‘test.cfm’ file anytime you want to test a piece of code independently.

The way I like to set up the Scribble Pad is to give it its own project space, but in it does allow you to point it to any project.  Here are the steps I take to set it up:

First, create a new CFML Project named Scribble. It should be noted that you can actually make your scribble pad point to any project, but I like to keep it separate and in its own space.

Now create a file in that project named Scribble.cfm.  As with the project, the name can be anything you like but it makes good sense to make it easy recognizable.

Now we have to tell CFEclipse to use that project/file for the Scribble Pad. Click on Window –> Preferences on the menu bar.  Then under the CFEclipse submenu, click on Scribble pad.

In the “File name to use as scribble pad.” box, enter Scribble.cfm.

In the “Project to use for scribble pad.” box, enter Scribble.

In the “URL to scribble file.” box, enter the full “http://….” path to that template.

Click OK and you are ready to use it.  Now when you are in the CFEclipse perspective you can click on the Scribble Pad icon below:

When the Scribble Pad launches you can enter any CFML code and run it in the browser below the editor.

Now, go delete all those ‘test.cfm’ templates!

Warning to early adopters… Ubuntu Edgy Eft vs. ColdFusion Installer

***UPDATE*** the fix is contained within the comments of this entry.  Make sure you read below the blog entry!

As some of you Linux fans may be aware, Edgy is being released this week. I did a dist upgrade to Edgy earlier this week, but rather than just upgrading I actually wiped clean and started with a blank slate. Everything about Edgy is awesome so far, except that there appears to be bug (for now) related to libc6.

When trying to install ColdFusion per my instructions in an earlier blog post , I receive the following errors:

dshuck@dshuck-laptop:~/software$ sudo ./coldfusion-702-lin.bin
Password:
Preparing to install…
Extracting the JRE from the installer archive…
Unpacking the JRE…
Extracting the installation resources from the installer archive…
Configuring the installer for this system’s environment…
nawk: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory

Launching installer…

grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/tmp/install.dir.31599/Linux/resource/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory

After doing some quick research it appears that there is a bug remaining in Edgy related to libc6 and I have yet to find a workaround. I would imagine that if I had installed ColdFusion on Dapper and they done the dist upgrade, it would be fine. The problem seems to be simply related to building it.

If anyone has any suggestions, I am all ears.

EDIT:  the comments for this entry were not imported from my previous blog host.  I am pasting them (including the fix)  below.

Brandon Harper said:
Dave,

If I were you I’d just install ColdFusion under Tomcat. Tomcat seems to be more Linux friendly than JRun anyway.

http://www.adobe.com/support/coldfusion/j2ee/cfmx7…

I have setup Tomcat on Ubuntu before and probably have some links for how to do it, let me know if you need them.

I honestly don’t do much CF at home (mostly Java and Python) so I have yet to set it up there, but that’s probably what I’ll end-up doing.

posted 1523 days ago
Add Comment
Reply to: this comment OR this thread

Tim said:
I upgraded to Edgy a few days ago with no problems (I couldn’t stand the Firefox 1.5x bugs). I guess the secret is to update, not reinstall. I was having a hell of a time with SSI, until I found the right HowTo for Ubuntu/Apache. ;-)
posted 1523 days ago
Add Comment
Reply to: this comment OR this thread

Thanks for the tip Brandon. I hadn’t considered that approach, but that may be a good idea. I am sure I can go RTFM, but I was under the impression that would still have to walk through the installer. Am I missing something? Alternatively, I am kind of thinking it might be a good excuse to play with Railo a bit at least until the Ubuntu team gets the libc6 bug resolved (assuming my diagnosis is correct!). I installed it on an Ubuntu Server recently with no issues and it seemed pretty cool.
posted 1523 days ago
Add Comment
Reply to: this comment OR this thread

Brandon Harper said:
Yeah, you’re right, I totally forgot about the installer part. I usually keep the WAR’s around so I can deploy instances of CF without needing the installer so I don’t have to deal with that step (and forgot you had to do that).

I wonder if you could run the Windows installer under Wine just to get it to create the J2EE WAR file which you could then fix and deploy to Tomcat? In theory there shouldn’t be major differences in what it creates, but who knows.. just for experimentation sake it might be fun to try out.

posted 1523 days ago
Add Comment
Reply to: this comment OR this thread

Brandon Harper said:
Actually the installer may not even work under Wine if it needs a JVM, I’m not sure really. I’ve never done any Java-fu under Wine.
posted 1523 days ago
Add Comment
Reply to: this comment OR this thread

Yeah, I think I will leave the Windows JVM out of this picture! I do however appreciate your thinking-out-of-the-box aproach. :)

I wonder if I can set up an install on another good box and export/import the war. Hmmmm.

posted 1523 days ago
Add Comment
Reply to: this comment OR this thread

Ron Stewart said:
Dave, any progress on getting this resolved and getting CFMX7 up and running on Ubuntu 6.10?
posted 1521 days ago
Add Comment
Reply to: this comment OR this thread

No, unfortunately not. However I have had almost zero time to dig into it. I will post back here when I find resolution.
posted 1520 days ago
Add Comment
Reply to: this comment OR this thread

Jeff Self said:
Hey Dave,

I’m getting the same errors trying to install ColdFusion on Edgy. Its a great distro and I’m liking the upgrade. I’ve been running Ubuntu inside of VMware Server 1.0.1 on my XP machine at work. The Edgy installation seems to run slower than the previous release. With the previous release, I could run it in full screen (1680×1050) as my primary desktop during the day only using Windows to check my email. But Edgy seems much slower at least in VMware Server 1.0.1. I’ve given it 512MB of memory but it just doesn’t respond as fast as the previous release. I might wipe the VM and install the older version and get CF installed before upgrading to Edgy.

posted 1519 days ago
Add Comment
Reply to: this comment OR this thread

Ron Stewart said:
… and to make this even worse, I get almost exactly the same set of error messages when I try to install New Atlanta’s BlueDragon 7b1 on the same box.
posted 1517 days ago
Add Comment
Reply to: this comment OR this thread

Alan said:
Gahhhh …. no updates? I just installed Edgy not long ago, but ran into this problem. I thought it was a problem with a small sized /tmp, but I think you’re right on the issue. I’d like to get away from windows for good, but this is going to hold me up until: its either fixed, or I again setup my dev environment on Dapper. There goes the idea of using Edgy for our new servers; thats too bad, cause I like the increased boot speed.
posted 1517 days ago
Add Comment
Reply to: this comment OR this thread

Alexander Grüneberg said:
Here comes the solution:

Fire up a text editor and replace the string “export LD_ASSUME_KERNEL” with “#export LD_ASSUME_KERNEL” in the following files: coldfusion, cfstat, cfmx-connectors.sh (or cfmx-connectors-run.sh) and cfinfo in the bin-direcory, and uninstall in the uninstall-directory (don’t think that this is necessary). Then it should work again…

Don’t forget to backup the files!

Regards,
Alex

posted 1517 days ago
Add Comment
Reply to: this comment OR this thread

Alex, I never get to the point where I actually have any files other than the setup .bin file. Is this solution aimed at people who have upgraded from Dapper to Edgy and ColdFusion no longer works?

~Dave

posted 1517 days ago
Add Comment
Reply to: this comment OR this thread

Alexander Grüneberg said:
Sorry, Dave. I forgot to mention that I’m still using ColdFusion MX6, where the installation works fine. The problem is defininately related to the string “export LD_ASSUME_KERNEL”, so try to open the setup .bin file (basically it’s not a binary file) with your favorite text editor and look for the above-named string. Naturally, you should create a backup file.

Hope this helps.

posted 1516 days ago
Add Comment
Reply to: this comment OR this thread

Ron Stewart said:
This very well may work — I just received a similar pointer from Gregg Orangio on the New Atlanta BlueDragon interest mailing list, and it worked for the installer for BD7b1. Gregg did suggest that when you tweak the installation script you change the “export” to “#xport” to comment it out, but to retain the original filesize (which at least the BD installer is apparently fussy about). I will probably give this a shot with the CMFX installer, too…
posted 1516 days ago
Add Comment
Reply to: this comment OR this thread

Ron Stewart said:
Dave, this did work in terms of getting CF7 installed on one of my Ubuntu 6.10 boxes (I say “one” only because I have tried it so far on just one of them). I have CF7 running on its own Web server at this point, and it seems to be OK. Something that I /didn’t/ expect was that it ran the installer in console mode, but it seemed to run just fine.
posted 1512 days ago
Add Comment
Reply to: this comment OR this thread

Alright guys I must be doing something goofy. I tried the fix that Alexander mentioned and that Ron apparently got to work but had another issue. I am finding that anytime I modify that .bin file and try to run it again I get the following error:
“Preparing to install…
Extracting the JRE from the installer archive…
Unpacking the JRE…

gzip: /tmp/install.dir.6645/Linux/resource/vm.tar.Z: not in gzip format

uncompress: /tmp/install.dir.6645/Linux/resource/vm.tar.Z: not in gzip format

gzip: /tmp/install.dir.6645/Linux/resource/vm.tar.Z: not in gzip format
The included VM could not be uncompressed (GZIP/UNCOMPRESS). Please try to
download the installer again and make sure that you download using ‘binary’
mode. Please do not attempt to install this currently downloaded copy.”

It should be noted that I first tried to edit in gedit and it gave an error saying that it didn’t recognize the encoding. I then opened in vi and just made my edits there. Any idea what I am doing wrong here?

posted 1511 days ago
Add Comment
Reply to: this comment OR this thread

Oh yeah… One other comment to add. I took Ron’s approach of changing export to #xport and got the following:

“Preparing to install…
Extracting the JRE from the installer archive…
Unpacking the JRE…
Extracting the installation resources from the installer archive…
The size of the extracted files to be installed are corrupted. Please
try to download the installer again and make sure that you download
using ‘binary’ mode.
Please do not attempt to install this currently downloaded copy.

posted 1511 days ago
Add Comment
Reply to: this comment OR this thread

David Low said:
I get exactly the same errors as Dave noted in the previous two comments. I tried to remove all traces of “export LD_ASSUME_KERNEL” to be safe, and edited the file from a text editor on a non-Linux machine as well – no joy.

This is trying to install a copy of Bluedragon JX by the way, not Adobe CF 6 or 7…

posted 1508 days ago
Add Comment
Reply to: this comment OR this thread

Tom Shearer said:
Hi,

I’ve been following this for about a week now ;) I’ve tried everything that’s mentioned here… no joy.

I’m posting here in the hope that there’s likely to be a solution to this posted here – I’ve checked all the other ubuntu forums, and no joy…

Thanks for the info so far though ;) it’s very informative – I also don’t want to move from ubuntu now I made the jump from windows.

posted 1507 days ago
Add Comment
Reply to: this comment OR this thread

Ron Stewart said:
Dave, et al: I don’t know if this would matter, but it might. When I made the suggested change, I used sed rather than a “normal” editor to make the change to the downloaded file.
posted 1506 days ago
Add Comment
Reply to: this comment OR this thread

Tom Shearer said:
Hi Ron, I used bvi for my changes, but I’ll give it a go with sed. Thanks for the tip.
posted 1505 days ago
Add Comment
Reply to: this comment OR this thread

Tom Shearer said:
Ron, I’ve tried using sed, and that was exactly the ticket:) Thank you very much indeed.
posted 1505 days ago
Add Comment
Reply to: this comment OR this thread

Brian Szmyd said:
I ended up just commenting out the logic that checks the file size :P Who cares right? We’re editing the file anyways:

#if [ ${ARCHREALSIZE:=0} -ne ${INSTALL_ZIP_SIZE:=1} ]; then
# echo “The size of the extracted files to be installed are corrupted. Please
# echo “try to download the installer again and make sure that you download”
# echo “using ‘binary’ mode.”
# echo “Please do not attempt to install this currently downloaded copy.”
# exit 16
#fi

posted 1497 days ago
Add Comment
Reply to: this comment OR this thread

Kasp3r said:
i just do the hack for libc6 and the install working fine for me on edgy.

cp coldfusion.bin coldfusion.bin.bak

cat coldfusion.bin.bak | sed “s/export LD_ASSUME_KERNEL/#xport LD_ASSUME_KERNEL/” > coldfusion.bin

posted 1496 days ago
Add Comment
Reply to: this comment OR this thread

Jeff said:
To all who are interested, I got it up and going on Edgy Eft. You can read how I did it here:

http://wulfshayde.blogspot.com/2006/11/ubuntu-610e…

posted 1488 days ago
Add Comment
Reply to: this comment OR this thread

Dave Ross said:
To answer the other question in this thread – yes – you should be able to drop the CF .war into Tomcat no matter what environment you built (aka ran the installer) on. I’ve built the war on windows and deployed to linux on MX6.1 no problems.
posted 1483 days ago
Add Comment
Reply to: this comment OR this thread

Christopher Jazinski said:
Thanks Kasp3r your ‘hack’ worked great
posted 1483 days ago
Add Comment
Reply to: this comment OR this thread

OK, as embarrassing as it it, I finally got back to this project. End of year deadlines are a beeotch! Kasp3r, your solution couldn’t have been any easier. Thanks.
posted 1455 days ago
Add Comment
Reply to: this comment OR this thread

Byron said:
I’ve just finished replacing the windows workstations and servers here at my home office with Ubuntu running VMware 1.0.1 server.

I have my legacy windows servers running as VMs hosted on the server and a workstation running Ubuntu 6.10. I’m not what you’d call an early adopter, more like a cautious observer and implementer. Anyhow.

I did run into trouble with my CF install what was running fine under 6.06 LTS prior to the dist upgrade I did; which ended me up here reading this thread.

After a little testing and more reading I used Kasp3r’s work around and voila; CF is up and running like one might expect under 6.10. Not 100% ideal, but since when has the world operated under ideal circumstances?

Anyhow, thanks one and all for the great ideas and dialog. I’m very happy with the way things are running for me here and can only encourage others to adopt the Ubuntu/VMware way.

Byron

posted 1431 days ago
Add Comment
Reply to: this comment OR this thread

We actually have some pretty high-traffic sites running in Windows as a VM in Ubuntu Server. It is surprisingly rock solid and performs well. Thanks for the comments Byron.
posted 1431 days ago
Add Comment
Reply to: this comment OR this thread

Mark Brown said:
Hey Dave,
Did you do all this on the server or desktop version? Does is matter which version one is using to do this?
posted 1370 days ago
Add Comment
Reply to: this comment OR this thread

I have done it on both. The same instructions apply. If you are doing this on Edgy or Feisty, make sure you read the comment above by Kasp3r at 11/21/06 8:43 PM. That was a lifesaver for me.
posted 1370 days ago
Add Comment
Reply to: this comment OR this thread

Cat toy said:
All the progs work! Thank Dave!
…but i prefer wp.

http://www.yeblog.info/cat-toy.asp

posted 1367 days ago
Add Comment
Reply to: this comment OR this thread

Steve said:
cheeeeeeeerio! you guys saved my sanity! it works! i love you all! :)

no honestly, this blog is the only resource i found that’s truly useful with this bug (or whatever it is).

thank you.

posted 1350 days ago
Add Comment
Reply to: this comment OR this thread

Aaron Roberson said:
Has anybody found a fix for this with BD7 final? I am getting this same error when trying to install it on CentOS 4.
posted 1349 days ago
Add Comment
Reply to: this comment OR this thread

Aaron, fwiw I installed BD7 JX yesterday on openSUSE 10.2 and didn’t have any problems. Are you getting the same error? Did you try the suggestion from Kasp3r?
posted 1349 days ago
Add Comment
Reply to: this comment OR this thread

Aaron Roberson said:
Dave,

I was able to get it working. For some reason it said the installer did not have permission to create a temp directory to install from. Before running the installer I had to set create a temp directory and set the installer to use it like so:

mkdir /opt/tmp; export IATEMPDIR=/opt/tmp; /opt/BlueDragon_Server_JX_70_339-Linux.sh

That worked!

posted 1348 days ago
Add Comment
Reply to: this comment OR this thread

Hans said:
Here’s a weird one…

Replacing ‘Export LD_ASSUME_KERNEL’ with ‘#xport LD_ASSUME_KERNEL’ works perfect on the i386 build of Debian 4.0r0 (Etch). However, I get an error when attempting to install on the amd64 build. (Yes, I am aware Adobe doesn’t support 64-bit, though it seems to work on other 64-bit distros so long as you use the i586 build of Sun’s JDK 1.4.2_11). The error:

./coldfusion-702-lin.bin: line 2317: /tmp/install.dir.4924/Linux/resource/jre/bin/java: No such file or directory
./coldfusion-702-lin.bin: line 2317: /tmp/install.dir.4924/Linux/resource/jre/bin/java: Success

Looking at line 2317 of coldfusion-702-lin.bin in vim doesn’t provide an easy answer (without really digging into the code). Oh well.

posted 1296 days ago
Add Comment
Reply to: this comment OR this thread

Hans said:
Should have occurred to me that my minimal install of Debian Etch didn’t have the libraries necessary to run 32-bit binaries. Doh. After ‘apt-get install ia32-libs’ the CF installer worked like a charm.

posted 1296 days ago

How I Broke My Database Addiction: Part II – The Solution

This is a continuation from a previous entry How I Broke My Database Addiction: Part I – The Problem

In refactoring this application, we have turned the architecture on its head and have completely redesigned the application from the ground up, but have had to keep the original design requirements intact. We are using Mach-II for our application framework, and using Reactor for ColdFusion as our data abstraction layer and ORM framework. There is far more to the rewrite than was discussed in the previous post, but for the purposes of staying on topic, I will cover how we have eliminated some of the excessive round trips to the server, and in turn eliminate the excessive trips from the server to the database.

The first and easiest thing to address was the custom settings that belong to each Company (our customer). These properties rarely change, so the obvious answer was to place them in the application scope. Our solution was to create a structure like this:

application.CompanyStruct[“CompanyId1”]

application.CompanyStruct[“CompanyId2”]

etc…

Each item in the structure is a Company Object, containing all the properties of a Company. Then in our Mach-II application, we have created a plugin to make sure sure that a Company is loaded on each end-user request. If a Company Object has not been loaded, the plugin creates the object in our application.CompanyStruct. When a customer administrator changes something about their company in the system, they simply mutate the value in the structure object and save, which both alters the application scoped Company Object, and persists it to the database.

Now, instead of retrieving this information on every single request of every single user, this Company is pulled only one time on the first request by the Company’s applicant.

Our application server and our database server nod in approval.

Next, we address the application form itself. In order to make the designers happy, we still have 9 tabbed “pages” in the application, but rather than continually make pointless round trips to the server, it is now a single page request to load the form, and the tabs are managed client-side. Now clicks between tabs are instantaneous, and our customers will hopefully stop wondering if the system has just forgotten about them. This obviously adds faster load times, but it also creates a new issue:

This is no small form!

Even if the user knew exactly what they needed for every form field it might take them 20 minutes to walk through it even if they knew what they were doing. Couple that with the fact that they might have to retrieve documents and records to use as reference, and you have to consider what might happen if they have gotten all the way through to the 4th or 5th tab and the walk away. Of course they could hit “save” and all would be well, but logic soon brings the obvious answer that many Users will not think to do so. After much deliberation, we came up with what we feel is a sound solution.

In the new system, a User will already be logged in by the time that they reach the application form page. This gives us a handle on them by use of a User Facade. In our model we have defined that a User hasMany Application (as in “he/she being an applicant”, not as in “ColdFusion application”). That way as we make changes, by adding/modifying/deleting values of properties of a particular User’s application, we do so only in the Application object that is a child of their User Object.

As a User walks through the form, we are using AjaxCFC to update the User’s Application Object with an onChange() event on each form field. What this means is that when a User has filled out the first 10 form elements, those 10 properties in their Application object have automatically been updated behind the scenes to reflect this. One important thing to note is that up through this point, the database is not updated in relation to this User’s.

So how do we update the database?

One was is when the User submits their Application. Thanks to cascading saves in Reactor, this is as simple as calling: User.save(), which then trees down through the User hierarchy saving dirty (changed) objects. Then we begin the submission process which is outside the scope of this post.

So, we still have the issue of what would happen if they just walked away. This brings us to what I believe is an under used gift that we received with CFMX7, that being OnSessionEnd().

(note: I started to make and reference a seperate blog post on the OnSessionEnd() method, but after a quick Google search, I see that Mark Kruger, Todd Sharp and others have this well covered. If you are not familiar with how OnSessionEnd() works, I urge you to check out those blog entries.)

Using the combination of cascading saves in Reactor and OnSessionEnd() we make solving this problem almost embarrassingly easy.

In our OnSessionEnd() method, we take the following approach:

(warning: pseudo code ahead)

if (User has an Application) {

User.save();

}

Yes, it is that simple!

So if our User has entered 20 form fields and his house is suddenly struck with a small meteorite, forcing him to leave while his house and computer burst into flames causing a total loss, never fear! When he logs in from his friend’s house the next day, his Application will still be in process, and he will not have to start over. Well… he won’t have to start the application over anyway.

Of course this begs the question – But Does It Work in Production?

Keep your fingers crossed! :)

How I Broke My Database Addiction: Part I – The Problem

Addiction: “Strong dependence or habitual use of a substance or practice, despite the negative consequences of its use.”

We are working on refactoring an old ColdFusion application that allows multiple companies to offer a custom and fairly complex application form for for their customers (applicants). In this application, an exceptionally large amount of data is collected from the applicant. Depending on the options that the customer selects to require from their customers, this can work out to be up to about 400 form fields. The designers of the application specified that it must consist of 9 tabbed pages, broken apart by like questions.

To preface, this application was written right about the time that CFMX 6 was released. The only use of CFCs is completely opposite to what has become best practice since that time. In this application, CFCs are not objects, but are more or less repositories for related UDFs, many of which are used as views to display sections of the application.

From an application flow perspective, the main form template which is the meat of the application is a single CFM file with a switch/case block that then includes the appropriate fields that the user should see (when it isn’t throwing exceptions) for whatever section they are in on the form, with each tab being a new request to the server. On each request, the application will make anywhere from 20-50 queries against the database to populate any data to the fields on the tab the applicant us on. To make matters worse, as a user works their way through the application, leaving a tab creates a submission and adds on another 20-50 insert/update/delete queries.

In addition to the data retrieved related to the User’s Application, each request forces the server to query the database to find out settings about the company that servicing the applicant. That is another (get ready for this…) 30-40 queries. It is very typical in this application for applicants to have to wait 4-7 seconds in between pages.

So this is a very high level of the problem… Put your thinking caps on and see what solution you come up to reduce this nonsense. Next I will share ours.

What rock have I been living under? Aqua Data Studio rules!

I was chatting with Matt Woodward this morning about his upgrade to Ubuntu from Windows. In our discussion,  I mentioned that the only real need I find for Windows is when dealing with MS SQL Server databases, at which time I either have to do an RDP connection to a remote machine or open up my Windows instance in VMWare .  I use dbEdit for Eclipse, and it works pretty well for looking at data, but it definitely does not give enough control for what you need in active development.  In agreement, Matt asked if I was familiar with Aqua Data Studio, which I wasn’t.  It is a platform independent database development tool that seems to offer much of the functionality that I need with SQL Server Enterprise Manager and Query Analyzer.  In fact, in my usage today I have yet to come up against anything that I couldn’t do, other than things due to my own shortcomings of course!  If you are interested, there are versions for Windows, Linux, OSX, and Solaris.

As I thanked Matt for directing me to such a great tool, he responded:

“cool–i thought EVERYBODY knew about aqua data studio ;-)

Well, I guess everyone does now.

Sweet… I got published!

A couple months ago I posted a blog entry on a cool multi-file upload tool that I had found. Shortly after, I was contacted by someone from SysCon and was asked to submit an article on implementing it using ColdFusion for the ColdFusion Developers Journal aka CFDJ.

It appears that they have added it to the most recent issue. I guess I need to go trackdown a print copy now! :)

If you are interested, here is the article.

Lessons learned using Reactor

After being a full-fledge supporter of Reactor for about the past 10 months, I have to admit that while it is without a doubt a *wonderful* tool, like anything it does have its limitations.

As many know, we rolled InstantSpot out as a MachII /Reactor project, and have been using Reactor exclusively for managing our objects and database abstraction. We built it so that all data is accessed and mutated through the reactor objects. From the very beginning of the rollout, we knew that we had some performance issues that we need to deal with, as page requests on the Spot sites themselves were taking a bit longer than we would have liked (OK, a *lot* longer)

As we started getting a little load on the system we saw some scary things. In heavy traffic periods the server just choked with the processor staying pegged out. Even just a single page request was sending the processor to 100% for several seconds. Immediately we knew we need to change some things, and finally did so over the past 3 days. Here is what we learned and what our resolution was:

First, let me be clear… Reactor was NOT the problem. However, the way that we used it was.

To put it bluntly object instantiation in Reactor is pretty expensive. Especially as the complex relationships get bigger and bigger. We found that out server was having to do *far* too much work for what we really needed out of it. For instance, when we load up a site record, Reactor does a wonderful job of transversing through the entire object hierarchy and having whatever properties and iterators ready for use. As we spec’ed out the project we thought we had accounted for all this work pretty well by using some fairly clever caching techniques. However, we found that we hadn’t accounted for it well enough!

While it is really cool to be able to use the getters and setters with such ease, we came to the realization that when it comes to simply displaying output of a site, there is really not any need for all that overhead. We decided to step back and re-evaluate.

What we ended up with was a series of complex structures of data (yes structures!) that are lazily loaded rather than all loaded being up front. Additionally instead of instantiating Reactor objects and using them, we instead chose to use the Reactor query objects to return whatever recordsets we needed.

For the control panel functionality, we continue to use Reactor objects, as it makes adding/modifying/deleting data an absolutely pleasurable task, and we are no where near crisis mode on the performance in those areas.

So, the outcome?

The difference has been incredible! Now rather than a page request pegging the processor for a couple of seconds, we see it spike way under 100% for a split second. Hopefully this will be of help some of you that are considering using Reactor for your projects.

From our experience to date, I think it is still a great choice for database abstraction, just be very mindful of how you use it.

Is ColdFusion harming itself?

I really hope the following doesn’t come across too preachy, but it is something that I have been thinking about for some time now.

Without a doubt ColdFusion is a *far* better language than it was when I started 7 years ago. With the maturation of the language, the development community too has matured to a point where there are virtually no beginner “how-to” discussions or blog postings, and more and more advanced theory discussions dealing with complex objects and design patterns. As I have been growing along with this trend I have been very excited about this direction and it is fun to watch the community buzz with each new concept and technique.

However… What are we offering the beginners? I am afraid that unfortunately as we continue to only cater to ourselves, we are blocking some new developers from being about to ease into the language. As was stated on the CFCDev list (which incidentally has had virtually no tech posting lately), there are no longer any intermediate questions being asked. Why is this? Are there no more questions? Or are there no new people asking questions? I admittedly haven’t listened to this weeks’ ColdFusion Weekly, but from a statement made by Peter Bell on the CFCDev list, they apparently speak on this issue as well.

At a recent DFW CFUG meeting I posed a question asking why we see the same few faces at our meetings, when we have a much higher member base. One of the newer developers mentioned that maybe the topics we are covering in the meetings are too complex and are going over people’s heads a bit. This caused me to reflect a bit and wonder who exactly are we trying to cater to and what are we accomplishing by having a ColdFusion user group.

I have often heard that when a church stops having an active youth group, you can start the timer counting down to its death, as there will eventually be no one to take the lead when the elders are gone. I would hate to think that the same scenario could exist for our community.

I would encourage all of us to consider this and think about what this might mean for ColdFusion. Perhaps for those of us who blog, we should not forget to include *all* the community rather than just ourselves.

EDIT:  Comments were not retained from my previous blog home, and there was an active comment discussion on this post, so I am pasting them below:

todd said:
Dave – I agree with you. That is why I try to post thorough explanations of beginner/intermediate techniques. I think a lot of times when a CF newbie starts reading some of the blogs that are out there, they can easily get overwhelmed with all the OO and framework talk that goes on when they just want to learn some new techniques or better understand how/why something is done. I think it’s important to break down some of these items so they can be easily understood. Then the newbie will have a better ‘foundation’ on which to build upon.

Can we do more to help? Are you and I the only ones who think this way? Would we be wasting our time?

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

Peter Bell said:
Hi Dave,

Really nice post. When I think of all the blogs and all of the postings I have seen over the last year or so, I think there two issues. Firstly, I am sure CF could do with a bunch more “gettign started” tutorials, so there is a place for that. However I’d argue the biggest issue isn’t the content but the lack of formalized discovery mechanisms. I would love if there were one or a few centralized recourses (other than Googling!) for accessing all of the great CF posts out there.

Think Brian Rinaldi’s open source roundup and then imaging the same for “Introducing Objects”, “Security”, etc. It would be lovely if there was a “go to place” categorized by topic. Then there is House of Fusion. I know they are “for profit”, but we need people like Michael and Judith creating that kind of space.

Solutions would be to have subject matter experts keeping an eye on postings and then putting together a list of well organized resource for their areas. Maybe we should just consider some public del.icio.us lists?!

Best Wishes,
Peter

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

Ben Forta said:
I could not agree with you more. And the CF team agrees too, which is why CFMX7 had more Getting Started material in the product as part of the default install than any version previously.

With all of the debate around frameworks and adding more Java functionality and so on it is far to easy to forget that the vast majority of CF users will never use any of that, and there are many more absolute beginners who have yet to experience CF and have much to gain by doing so.

Well said!

— Ben

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

Phil said:
Dave, great post. I wholeheartedly agree with you. There aren’t those beginner type tutuorials or even blog postings out there. There’s really only one book for starters, the WACK, and the mere size of it can be very intimidating to someone. I only get digests deliverd for many of the CF lists because the topics tend to be somewhat advanced and specific to someone’s situation. I also think when beginners come on board, they start to see posts on Fusebox, Mach, Model-Glue, etc., and can feel overwhelmed on where to start. Maybe there needs to be a cfbeginner.com or something. Also, there aren’t many beginner type items on the Adobe (and before that Macromedia) developer center. Also, I’d be interested to see what Adobe’s training is like for the initial ColdFusion training class and the makeup of its students. I just wonder how much new blood is really coming into the community. Well, I guess that’s my extended .02, Phil
posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

todd said:
Ben – the Getting Started stuff is great – _but_ here is the million dollar question – how do you reach the people that just refuse to RTFM?

Online resources (like blogs and wikis), to me, are the easiest to learn from. It’s almost like being spoon-fed a lesson at a time. Plus, the added benefit of comment threads allow you to question/discuss the material (almost like an online classroom).

I think the hardest part for beginners though with blog learning is “where do i start”? Like Peter, I wholeheartedly agree with the need for an online resource – almost like an online WACK…maybe a Wiki? I don’t know all the answers, but I think we’re missing the boat for some beginners due to the lack of a formalized online resource. The cfcookbook is a start, but it’s more prescriptive I think.

As I said above, I’d be more than happy to participate in the creation of anything that can help lower the learning curve for people getting started.

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

Ryan Everhart said:
Dave,
I too agree with your post, very well said. On a scale of 1 to 10, 10 being high, I feel like I’m around a 5 or 6 lately with a lot to learn. Some of the discussions on the CFCDev and Mach-ii lists go right over my head and then others I THINK I understand.

As for the beginers, what about places like the <a href=”http://www.coldfusioncookbook.com/“>ColdFusion Cook Book</a> and <a href=”http://www.easycfm.com“>EasyCFM</a>. Those are two sites I visit ever now and again to get some basic stuff.

I’ve been trying to think of content for my blog so I might take your thoughts and run with them. I don’t know if know enough yet to cater to the intermediate community, but maybe I can share with the newbies.

Thanks for the idea,
Ryan

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

Andrew Powell said:
The blog entry that ColdFusion Weekly was discussing can be found here:

http://www.infoaccelerator.net/client/index.cfm/20…

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

Ben Nadel said:
Dave,

Nice post. CFSkill.com is trying help people move to the next level. I was trying to participate with CFSkill, but it was actually too advanced for me. For that reason, I have taken it upon myself to built a Demo ColdFusion Application from the ground up with a highly iterative and highly explained / commented journey. This is primarily for me so that I can “think out load” about applicaiton development and one day be able to tackle higher level frameworks, but ultimately, I think it would be awesome as a teaching tool for anyone at any level as it is going to (currently a work in progress) really step by step build and application from scratch.

Anyway, still working on it ( http://www.bennadel.com/skin-spider/ ) , but I agree with you that we cannot forget about the *little people*. The CF community is getting so advanced that half the time I feel like the little people and i have been doing this for the better part of a decade.

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

Brian Rinaldi said:
I came to a similar conclusion one day at the Boston CFUG. I was the only one doing anything OO or using a framework. We of the CF blogging community (and by this I mean me), tend to lose sight of where the community is as a whole because we have this tight circle of people whom we “watch” every day and who have similar propensities and skillsets for the most part. I actually left that meeting and started writing my objects and frameworks series of posts which are designed (I think) for beginners. The perspective I try to take is that I was there, very new to OO and frameworks and such not so long ago and I am still figuring it out.

However, your post begs the question also, are we focusing on OO and frameowrks to the detriment of other “advanced” topics as well? Yes, probably we are. However, I do see a wide range of levels represented on CF-Talk. I think the “death” of CFCDev (sorry if that upsets anyone, but I have even contemplated unsibscribing lately) was brought on more by spammers than by the CF community. The activity after the outage and move has been far less than it was prior, with still a noticeable portion being spam. I am curious if CF-Talk activity perked up since…perhaps the questiosn didn’t go away, just move elsewhere?

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

cfjeff said:
BINGO !!!! WE HAVE A WINNER !!!!!

It’s nice to know that CF has technical underpinnings but it’s not what the customer is buying. I started useing CF because IT IS SIMPLE and continue using it because IT WORKS.

The connection with Flash and Adobe is exciting, but I will not be doing any FLEX. It’s just more complicated than I need. On the other hand, I love the Flash charts and would use more of the PDF and Flash if it was as easy to use.

I feel better now, sorry for the all-caps.

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

Alan Dix said:
Nando is sort of on this track too.

http://aria-media.com/blog/index.cfm/2006/9/27/The…

Probably wouldn’t be a bad idea to post “Newbie” stuff once in awhile. We were all newbies once, and and Nando states, we all kind of feel like Newbies once in awhile.

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

Michael Dinowitz said:
You do know that there is a CF-Newbie list that is actually active, right? Have been seeing the basic and intermediate level questions being asked on CF-Talk? Have you read the Fusion Authority Quarterly Update, which is designed to be very easy on the newbie while still bringing heavy, high level content?

No disrespect, but is seems like your missing something in your post.

posted 1546 days ago
Add Comment
Reply to: this comment OR this thread

Michael, while that is a good advertisement for your stuff, I think the point of Dave’s post was that the majority of active bloggers are exhibiting this trend. From all of the comments it seems like he isn’t the only one who has this perception.

~AJL

posted 1545 days ago
Add Comment
Reply to: this comment OR this thread

Michael Dinowitz said:
Forgive me if I’m reacting defensivly, but I was not advertising my lists or journal. If I was, I’d have included links.

While you are focusing on his mention of blogs, I’m focusing on the point of discussion and intermediate level questions being asked. The point does not change though. There are many places where beginning and intermediate questions are being asked. There are many sites catering to these levels of questions. I can tell you about a few other things going on, but some of them will probably fall under the heading of advertising.

Blogs are not going to be one of those places as bloggers are usually giving their own thoughts and these thoughts are probably going to be high level. But then again, look at Ray’s blog posts which are always informative. (advertising for Ray now)

posted 1545 days ago
Add Comment
Reply to: this comment OR this thread

Sean Corfield said:
And everyone here needs to bear in mind that the vast majority of ColdFusion developers don’t read blogs and many of them aren’t subscribed to mailing lists either (let alone attending CFUGs). The ColdFusion blogosphere is a very distorted view of the “real” ColdFusion landscape.

cf-talk and the associated lists are more representative than blogs but even there only a small percentage of ColdFusion developers are represented and the traffic is so high that many people who view programming as their job simply don’t feel they can spend the time to read all that stuff.

This is why, in response to the comments about skills gaps, I suggested that what we all need to do is find one or more ColdFusion developers who doesn’t currently read any blogs or lists or attend a CFUG and encourage them to do so. We need to reach out an involve those “9-5″ programmers and help them see the benefits the “community” has to offer.

posted 1542 days ago
Add Comment
Reply to: this comment OR this thread

Another thing to consider, is that while many developers don’t actively read blogs or lists…They probably do search the internet for solutions to problems/challenges they might face.

Having well-indexed (by the search engines) bloggers posting good entry-level tech will likely add to the available search returns for those 9-5 developers. And maybe even hook them in to your blogs! :)

Just sayin’

~AJL

posted 1542 days ago
Add Comment
Reply to: this comment OR this thread

Christopher Yager said:
Another thing to think about is that ColdFusion today is not what it was in the Allaire days. I know that I and alot of others matured as the product was maturing, so a newbie today is coming into a product much more advanced then what we saw when we first discovered it.

Two years ago I spent alot of time training my “procedural developers” oo design and development, and we upgraded our Public facing sales flow to Mach-II, which has been a god send as requirements keep changing. I can’t speak for Adobe, but it seemed like Macromedia as a whole was definately pushing developers to OO development. If this is still the track Adobe is pushing for, then I would think those beginning tutorials should still be wrapped around entry level OO concepts.

What troubles me more than seeing a lack of entry level tutorials, is the focus of www.adobe.com, it seems to me that they are more focused on the designer than the developer. Let’s take the true infancy of a ColdFusion developer, I would assume one of the first places they would start is probably going to be www.adobe.com (the source). At a first glance of the site I am already overwhelmed and the product list is so vast now, that bubbling up any detailed information would be difficult. I just remember all the tutorial teasers on the old Macromedia Site and A “Developer” main menu tab. To me it seems that “ColdFusion” has been relegated to a single link taking you to the product page. Where the front page focus seems to be on development. Just my opinion.

So I guess the challenge is, how do you ease someone into a technology from a simplicity point of view, when the product continues to become more complex inside a company that has become infinately more complex. But, at least it’s easier to find the bigginers tutorial on adobe.com than it is to find the java beginers tutorial on SUN… and who wants to code a bicycle app anyhow. :P

posted 1540 days ago
Add Comment
Reply to: this comment OR this thread

Christopher Yager said:
I meant to say “Where the front page focus seems to be on design”
posted 1540 days ago
Add Comment
Reply to: this comment OR this thread

Sean Corfield said:
Christopher, you can go directly to the ColdFusion product page from the main “Products” menu where ColdFusion is one of just sixteen products listed (there are many more products in the Adobe fold). You can also go to ColdFusion from the “Solutions and Products” pod directly under the banner on the home page. Or you can get to the *developer center* from the “Communities” main menu item (separate options for designer / developer). I think your comment does a great disservice to both Adobe and to the many, many developers (and designers) who use their products.

Are you saying you’re unhappy because ColdFusion is no longer owned by a “one-trick pony” where it was the main focus of a company? It seems to me that the budget and brand power of Adobe does more to benefit ColdFusion than Allaire could ever afford to. Look at the increased number of conferences for ColdFusion, look at the ever increasing attendance at those conferences! Look at how ColdFusion is promoted as the ideal back end for Flex (and how important Flex is to Adobe)!

posted 1540 days ago
Add Comment
Reply to: this comment OR this thread

Christopher Yager said:
My post was not meant to discredit what Adobe brings to the table for Coldfusion. I was just saying that since Adobe was in control, I have seen less focus on ColdFusion from a site content point of view. This may come from the sheer faact that their is so much more to cover at this point. And I always have been pleased that ColdFusion has been targeted as the data and service provider for Flex.

My only point is that for someone looking for the right web development language or a ColdFusion newbie, the site can be a little much to take in.

I apologize for sounding like I was taking a shot at Adobe… that was not my intention.

And I agree, as we come into contact with more jr. ColdFusion developers, we should introduce them to User Groups and the getting started pages.

posted 1540 days ago
Add Comment
Reply to: this comment OR this thread

Sean Corfield said:
I’m not sure that the beginning Dreamweaver user or beginning Photoshop user or beginning {insert Adobe product here} user is going to face an easier / worse task that a beginning ColdFusion developer here? There is a developer center linked from each product (well, they are design centers from the design-centric products) and in each of those centers you’ll find tutorials and getting started sections.

I’m genuinely trying to find out what we could do to make it better for new users for the products. You have some criticisms which I felt were unfounded because ColdFusion *is* featured on the home page and in the main menu (on every page) and developer tutorials etc are easy to find.

I agree that if you come to the site looking for just one product, it may be a bit overwhelming to see sixteen represented in the menus (Adobe has something like 75 products covered on the website so take comfort in ColdFusion being in the top 20%!). I think that might just be a fact of life with such a range of products.

Out of curiosity, I typed “coldfusion” into Google and the top results were: Adobe’s ColdFusion product page, the wikipedia entry for ColdFusion, House of Fusion and the ColdFusion Developer’s Journal (Sys-Con). Ben Forta’s site is 6th on the list. The ColdFusion FAQ (derived from CF-Talk posts) and Fusion Authority are also on the first page of results.

What would you like to see done differently?

p.s. Don’t forget that adobe.com is powered by ColdFusion (there are now thirty instances running on a ten server cluster!).

p.p.s. Dave, your captcha seems broken – it always fails the first time for me on Firefox OS X.

posted 1540 days ago
Add Comment
Reply to: this comment OR this thread

Raymond Camden said:
I know it is a bit off topic – but I saw cfcdev mentioned multiple times. We did suffer greatly – and we still have a spam issue. I’m going to try to work on that now. I know the memberlist is very low now. I’m not sure why. I mean – yes – the list did go balistic – but I’d hope folks would understand that stuff like that just happens – especially when we are talking about a _community_ resource being run for free.
posted 1539 days ago
Add Comment
Reply to: this comment OR this thread

Charles said:
I’m pretty much a beginner, in that for the last two/three years I’ve been doing some serious procedural code on a very large app. Before that I was a system admin and IT manager — no programming experience at all.

While I agree something like a beginner’s wiki would be awesome, at the same time, I’ve got Ray Camden’s and bunch of other folks dialed up in my newsreader and read them frequently. Because I don’t want to stay a beginner at this stuff. The more I try to emulate some of the real experts out there, the better I’m doing. So yes, more for beginners. But to those out there who are exploring bleeding edge stuff — don’t stop!

posted 1532 days ago

New Subversion development environment

The development team that I am working with originally started out as two developers. We had about 4 applications between us and rarely were we working on the same application, much less the same piece of code. We simply mapped our development IDEs to a mapped drive on the development server and worked on what we needed to. When a piece of code was ready it would be moved to a staging server to be tested, then moved to production. If for some reason we were working in the same area, we would just shout over the wall and warn the other. Sound familiar? If you are on a small team, I am betting it does.
As our development team has grown we have definitely found a number of weaknesses with this approach, including:

  • Accidentally overwriting another developer’s work, or worse… having *yours* overwritten!
  • Lack of a clear trail of historical changes. Yes, of course we are all supposed to sufficiently comment all changes, but in reality we all know that this occasionally fails to happen.
  • Lack of trail of ownership. (see “commenting” above)
  • By pushing up one file at a time both to staging and then to production, we found that over time we had some variances between what was on the production server as opposed to what was in staging, and often a vast difference from what was in development.
  • No easy way to roll back to a previous state of the application.

This has been one of those growing problems where we knew we needed to implement source control, but in the heat of development, when on earth would we ever find spare time to do this? We finally decided it was time to make time.

The following is the approach that we took, and has worked really well for us so far. For the purposes of this document, we will be calling the applications app1.domain.com, app2.domain.com, app3.domain.com, and app4.domain.com.

We first altered our web server so that each developer has their own development environment, including their own instance of ColdFusion, a directory structure completely separated from the others, and their own databases mirroring the production databases (eg. app1database is named dave-app1database). So, now our development directory on the server looks like this:

-aaron/CustomTags/ (each developer has their own copy of the global custom tags directory)
-aaron/app1.domain.com/
-aaron/app2.domain.com/
-aaron/app3.domain.com/
-aaron/app4.domain.com/
-dave/CustomTags/ (each developer has their own copy of the global custom tags directory)
-dave/app1.domain.com/
-dave/app2.domain.com/
-dave/app3.domain.com/
-dave/app4.domain.com/
[repeat with other developers]

Given this model, when I am testing the code I am writing for app1.domain.com, I can access it in the browser by going to http://dave.app1.domain.com

Next we installed Subversion on the development server and imported the current production code as individual projects (CustomTags, app1.domain.com, app2.domain.com, app3.domain.com, app4.domain.com).

The Development Process:
Now that we have the model in place, anytime that a developer is assigned to work on a project they simply check out the code for that application. When they are ready to submit back to the repository, they first need to synchronize with the repository to see if anyone else has modified any code in the project. If so, they need to update their development instance with those changes and retest to make sure that their changes play nice with any other changes. Assuming all tests are fine, they can then commit to subversion and notify the project manager. In the event of a conflict where another developer has committed changes to a file that they are working with since checkout time, Subversion makes it easy to compare the changes and merge the two versions gracefully.

The Deployment Process:
Once changes have been committed the project manager archives current staging code, and replaces it with a Subversion export from the repository. By taking the approach of moving code the application as a whole unit,rather than the piecemeal approach of moving whatever files we have changed, we are eliminating the potential for accidentally forgetting to move any changed files, thereby keeping the application in tact. Once the staging environment has been completely tested, the same approach is then taken to move the code to production.

We are now about 2 weeks into this environment and all is going well… except the following scenario. What if you aren’t ready to move *all* the changes yet? Stay tuned for another entry soon on branching projects.