[Looking for Charlie's main web site?]

Getting MaxLength Validation to work with CFTEXTAREA Richtext="yes"...busted, but with a workaround

Note: This blog post is from 2008. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
Have you tried to use the maxlength validation with the new CF8 rich text cftextarea? You'll find that it simply doesn't seem to be working, or works inconsistently. I've done some digging and found why it's not working as it should, and I also offer a workaround for you if interested.

Now, some might point out that with CFFORM maxlength validation, you need to remember to set validate="maxlength", and that's true. And you provide a maxlength attribute and value, as well, but neither of those are what I'm talking about. Nor is it about the fact that you have to account for the underlying HTML that's generated. The validation simply doesn't work as it should, as I'll explain.

The root of the problem

Note that I say it doesn't work as it should--I'm not saying it never works. You can actually get it to trigger a maxlength failure, but it's just not working right.

Here's the deal: what's validated is the length of any data that prepopulates the field, not what the user enters into the field. In other words, it doesn't matter what you (or your user) types into the field. That will not be what's checked, but rather what was there initially. Not too useful (and confusing, for sure).

Let me be more explicit: if there's no text prepulating the field (what's between the CFTEXTAREA) or it's less than the maxlength, then the form submission will always pass without error even if you add lots of text to the field. That's certainly not right.

Conversely, if the field is prepopulated with text that exceeds the maxlength, then the form submission will always fail for the length validation, even if you remove enough text that it should pass. Again, all this could be very confusing if you don't understand what's going wrong.

As an aside, not that it matters to this problem, note that you can also prepopulate a CFTEXTAREA with a Value attribute (not something you can usually do with a normal TEXTAREA.)

A simple sample to test with

Here are 2 examples of what I'm describing. You can drop each into a page (it's a self-posting form, so it doesn't matter what you call the file):

<cfform>
Description (up to 10 characters):
<cftextarea name="description" validate="maxlength" maxlength="10" message="Description must be 10 chars or less" richtext="yes" toolbar="Basic"></cftextarea>
<input type="Submit">
</cfform>

If you run this, you'll notice that it will always pass, regardless of what you enter. Why? Because it's prepopulated with nothing, and that passes the validation, regardless of what you type.

On the other hand, the following will never pass validation, regardless of what you enter, because it's prepopulated with something longer than the maxlength:

<cfform>
Description (up to 10 characters):
<cftextarea name="description" validate="maxlength" maxlength="10" message="Description must be 10 chars or less" richtext="yes" toolbar="Basic">1234567890123</cftextarea>
<input type="Submit">
</cfform>

Obviously, none of this is what you would expect. If you've had people complaining about problems, it's no wonder that you'd be really confused.

(And of course, 10 is too low a number for general use, and unless you're doing an update form you wouldn't likely prepopulate your field as I have, but these make it easy to demo the issue.)

Maxlength validation works fine for CFTEXTAREA, as long as it's not rich text

Now, all that said, things will work just fine if you take out the richtext and toolbar attributes. Go ahead and try it. So clearly it's the richtext feature that's busted with regards to maxlength validation.

Why it's not working

I did some digging into the cfform.js file, which is where the code to do validation lives (in /CFIDE/scripts/) and I found the problem. What's passed to that validation code is not what's typed into the rich textarea (which is itself an iframe buried pretty deep in some code that the FCKEditor builds), but rather what's passed is just the HTML form field value, which in this case will be what was entered into the field when it was initialized (when the page is first loaded).

The ultimate solution is that the CF validation process needs to be changed to instead get the length of whatever was entered into the fckeditor control.

From further digging into that, with regard to some FCKEditor info I found, one might conclude it would be impossible. Many have complained about wanting maxlength validation with the control, and folks working on the tool have said it's a limitation the control.

But here's good news: I did still more digging and learned that the CF javascript API for the new ajax controls does indeed provide access to this information! Woo hoo! You can access it via the ColdFusion.getElementValue('thefieldname') method. With that, one can then test its length.

For now, it's just something you need to do manually. I'll offer some code below that presents how to do this.

Don't forget to account for the generated HTML

Before I show the code, take note about your use of any maxlength test in the richtext textarea (whether it's done by CF itself in the future or by using this manual test): you (and your users, and any messages you give them) need to take into account that the rich textarea will have a length that's longer than just what the user sees/types.

Even with just an "x" entered in a richtext textarea, the underlying content created by the control (and as submitted to the form processing) will be surrounded by paragraph tags:

<p>x</p>

So that x would then have a length of 8 chars! Just be careful that if you need to tell them they can enter no more than 100 characters, because you're entering the text into a database column of that size, then you need to make it clear that they won't be able to really type 100 characters. And the more formatting they do, the less space they'll have.

In my code below, I offer an option for the validation error message to show them the text as entered, with the html coding.

An example of some code to check the real value entered

So the answer is in using the ColdFusion.getElementValue method, passing it the name of the textarea field to be validated. Using that, and its length property, we can do the needed test. As a quick example, here's a demonstration where the cfform onsubmit method is called to display the real text entered in the field, and its length. Note that I gave the cftextarea a name of "description", and that's what I name in the getElementValue (note that all Javascript is case-sensitive, from method names, to variable names, to names of fields accessed in code):

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function testlen(){
   var body = ColdFusion.getElementValue('description');
   alert('text=' + body + '\nlength=' + body.length);
}
//-->
</SCRIPT>

<cfform onsubmit="testlen()">
Description (up to 10 characters):
<cftextarea name="description" richtext="yes" toolbar="Basic"></cftextarea>
<input type="Submit">
</cfform>

With this code, whatever value you enter will be displayed, along with its length.

Now, one may point out that an alternative to using OnSubmit on the CFFORM would be to use OnValidate on the CFTEXTAREA. Well, yes and no. It would normally be a good choice, but we will see later that we will want to create a more flexible form of this code, where we will pass in the name of the field, a test length, and optionally a message to display. The OnValidate only let's you name a method to call, without naming arguments. It's designed to automatically pass in the form field value, just like the built-in validation process, but just as that doesn't work with the rich textarea, so too does it not work for this challenge.

A proposed solution to the textarea richtext validation

So with all that as preface, here then is some code I've put together that may help those wanting to do Rich CFTextArea validation. I've designed it so that you can name the field to validate, the length to test, and optionally an error message to display if it fails the validation, along with an option of whether to show the HTML-formatted generated content in the message.

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function testlen(field,maxlen,msg,showval){
   /*
   Validates maxlength for a CFFORM CFTEXTAREA richtext field.
   Created by Charlie Arehart, carehart.org, 8/1/2008
   - field (required): name of rich textarea field on form to validate (case sensitive!)
   - maxlen (required): the maximum length to be permitted for the length of the textarea body (including generated html)
   - msg (optional): a message to be shown to the user, or empty string ('') to show a default message defined as "defaultmsg" below
   - showval (option): if 'yes', will show the actual generated body as part of the message
   */

   var body = ColdFusion.getElementValue(field);
   var defaultmsg = 'The ' + field + ' field must be less than ' + maxlen + ' characters.'
   // test textarea body length    if (body.length > maxlen) {
      // if no message is passed in, create a default one (the onsubmit in cfform seems to require all args be passed, so 3rd arg can't be left out, but an be set to '')       if (msg.length < 1) msg=defaultmsg;
      // show the current value, if requested       if (showval == 'yes') msg=(msg + '\nCurrent value (with HTML) is:\n' + body)
      alert(msg)
      return (false);
   }
}
//--> </SCRIPT>

<!--- note that for the cfform onsubmit, it appears you must specify all args of a called function --->
<cfform onsubmit="return testlen('description',10,'','yes')" >
Description (up to 10 characters, including HTML):
<cftextarea name="description" richtext="yes" toolbar="Basic">12345</cftextarea>
<input type="Submit">
</cfform>

<cfif cgi.request_method is "post">
   <cfdump var="#form#">
</cfif>

The key is in the call in the onsubmit to the testlen function. The comments explain that it takes the 4 arguments I mentioned. In this case, it's calling testlen('description',10,'','yes'), which is testing the "description" field, for a maxlength of 10, and I'm letting the function create the default error message, while I do want it to show the user the formatted value if they get the validation error. If you want to provide your own message, just provide that in the 3rd argument.

Now, you might think that if you want to skip the 3rd argument but privide the 4th, you could just let it be left unspecified, as in testlen('description',10,,'yes'). But for some reason the OnSubmit attribute of CFFORM doesn't like that. So just specify it as '' if you want to set the 4th arg to 'yes'.

Naturally, if you're happy with the default message and you don't want to show the formatted result to the user, you can then leave off both the last 2 arguments, as in testlen('description',10).

Note as well that you want to call the function (in the OnSubmit attribute) using the form "return testlen(...)", as I have. If you don't, then the form would be submitted anyway even if it fails the validation. By using the return, you cause the result of the function to drive whether the submission takes place, and it returns false if the length test fails.

I could make the function still more robust, testing incoming arguments and such, but it will work for most needs as long as you're careful. Again, remember that when you pass in the name the field, it must be the exact same case and spelling of the CFTEXTAREA name.

That's it. I hope it's helpful. Please let me know what you think in comments, whether it helps or if you see a problem, etc.

Let's hope this is addressed in the CF engine

It would sure be nice to see Adobe get this fixed in the engine. I hope this may help. I'll file a bug report pointing back to this for the details. I've already filed it in the LiveDocs as well.

I will say that if this problem remains into the next release, then the MaxLength attribute and validate="maxlength" option should be removed both flagged as unavailable for CFTEXTAREA when richtext="yes".

Add searching for CF blogs, docs, etc. to your FireFox Search bar list of search engines

Note: This blog post is from 2008. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
Someone who had learned of my CFSearch search engine (which searches over 1300 CF blogs, docs/article sites, and more) wondered if they could arrange to have it appear in the Firefox Search Bar in the top right of the browser. The answer is yes, via a simple Firefox add-on (which you can use to add any search site to the search bar).

This is a cool thing, because while you can choose from several pre-defined search sites (google, yahoo, amazon, ebay, and more), and you can click a "manage search engines" option to go to a Firefox site to find still more, you can only pick those that are listed on the Firefox site.

As with this gent, some search engines will just never be popular enough to be listed there. So how to add them?

Get the "Add to Search Bar" Add-on

The good news is that there is a FF add-on that does just what he wants, Add to Search Bar. It's simple and very effective (see the comments at the Mozilla page link, where many ask--rightfully so--why it's not built into FF.)

You can also learn more about it in someone else's blog entry highlighting it.

How about accessing a site's search feature using a single keyword in the address bar

FWIW, I'll also note that rather than use the FF toolbar, one can also set things up so that a given page's search feature can be accessed from a single address bar keyword (if they don't have or don't want to alter that search bar in the top right). I blogged about that in my TipicalCharlie site, where I sometimes blog things that aren't of a CF nature but might appeal to just anyone. (Update: tipicalcharlie domain is no more, but page recovered using Archive.org.)

One more time about CSEs

Finally, just as a reminder, the CFSearch site I created is what's called a Google "custom search engine". I wrote previously about them and how other people had also come up with their own variants. You may want to check them out, too.

Getting the new CF8 Rich TextArea working right, from the start

Note: This blog post is from 2008. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
If you try the new CF8 html rich textarea (cftextarea richtext="yes"), you may be surprised by a couple of things. They may even discourage you using the feature, which is too bad. Here are some simple solutions. Note that I'm NOT referring here to the older Flash-based textarea that was added in CF7. The new rich text textarea is pretty nifty, if you can get by these couple of likely hitches.

First, you'll want to set the "toolbar" value

First, if you don't specify a "toolbar" attribute, you'll get a pretty ugly looking default toolbar with 3 rows of LOTS of icons. Now, if you read the docs, it will point out that you can get a simpler subset with setting the toolbar to a basic setting. But then, if you're not careful, it will complain:

toolbar set "basic" does not exist

A search of google (or the CF docs) won't turn up much.

Second, it's "Basic", not "basic"

So what's the solution? Well, it turns out that it's simply that the attribute is case-sensitive. Doh! So a working example is:

<cfform>
<cftextarea richtext="yes" toolbar="Basic" name="somefield"></cftextarea>
<input type="Submit">
</cfform>

<cfdump var="#form#">

Note that, of course, you do need to do it within a CFFORM tag. I've added a CFDUMP to show the results when you do submit it.

That offers a nice single-row set of icons. (The alternative value, to get the default list, is "Default" (not "default"), but if you leave the toolbar attribute off, you'll get it anyway. The docs (see below) talk about how you can modify what icons you see by creating your own custom toolbar. It's just that the docs don't clarify well this issue about the basic value being case-sensitive. (I've added comments to the livedocs which have been accepted.)

Don't use Rows/Cols, use Width/Height

Here's another bummer that's not well documented: when using CFTEXTAREA, the traditional ROWS and COLS attributes (of a normal Textarea tag) have no affect at all, whether you're using an HTML or Flash-based CFTEXTAREA.

The solution: you must specify Height and Width (in pixels). (You won't get an error if you use rows and cols, they just won't have any effect.)

Some other issues

If you haven't noticed, when you submit such a rich text textarea, what you get in the form submission is the entered text with HTML tags representing whatever formatting the user applied using the toolbar, or keyboard shortcuts, like Ctrl-B for bold. (I'm really not interested in debating here whether the HTML it creates meets everyone's preferences. Please take that up on the livedocs comments area.)

Finally, I'll point out that the docs (the Developers Guide page, at least) shows using the attribute as richtext=true. FWIW, this can also be specified as "true" (quoted) and "yes". I just mention this in case anyone may go doing google or adobe site searches to find more on the use of the feature. You might not find all there is if you're too specific about these "richtext" attribute values.

Where to find help for still other issues

If you need more help on or introduction to the rich text textarea, I'd point you to blog entries by other folks:

And of course see the docs:

Finally, I'd like to clarify that I really don't mean for this blog entry to become a place where all manner of problems related to using the rich textarea are discussed. I'd ask that please you keep any questions or observations related to just really fundamental aspects of using it, and take up other concerns at the Adobe CF Forums, especially the CFORM forum.

45 Page User Guide for the CF 8 Server Monitor

Note: This blog post is from 2008. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
If you're exploring the ColdFusion 8 Server Monitor, or perhaps have been using it and wonder if you may be getting all you can out of it, I want to point out an available 45-page user guide for it.

Ok, that's a bit of a tease. I'm referring to my 4-part series of articles on the Monitor available in the Adobe Dev Center. While I did them several months ago, I still often see people ask questions that are answered there, so I wanted to take a moment to remind folks of its existence. I realize that everyone may not keep up on the articles posted in the DevCenter (but I'll note that I offered an entry recently on how to keep up on new postings there and elsewhere.)

My CF8 Server Monitor article series was divided into 4 parts, which I've listed below. I also show here each articles's sections. (Note that the "table of contents" offered on the left of the online articles doesn't always list each section heading: it's more for breaking up the articles into managable sized online pages, which is too bad if one uses them as a gauge of the article's sections.) I've also broken down the sections into subsections.

  • Part 1: Using the Server Monitor in development
    • Unlocking the "black box"
    • Starting and using the Monitor
    • What it means to "Start Monitoring" (or not)
    • Useful monitoring for development
      • Tracking shared scope memory utilization
      • Track slowest tags or function calls
      • Tracking largest variables in a request
      • Tracking JVM Memory Usage
      • Tracking cached queries
      • Tracking large, slow, and frequent queries
  • Part 2: Using the Server Monitor in production
    • Challenges in managing a production ColdFusion 8 server
    • More zero-overhead reports
      • Template Cache status tracking
      • Session tracking revisited: active sessions over time
      • Tracking ColdFusion errors
    • Reports enabled with monitoring, profiling, or memory tracking
      • Avg Response Time and Requests Per Second
      • Active Requests
      • Queued/running requests over time
      • Finding heavy hitters
      • Active Queries
    • Aborting unresponsive or troublesome requests
  • Part 3: Automated monitoring and request management with Alerts and Snapshots
    • Automated monitoring and request management with Alerts
      • Toward 24x7 operations
      • Configuring Alerts
      • Available actions (overview)
      • Types of alerts
      • Viewing Alerts data
      • Available alert actions (details)
    • Substantial diagnostic details with Snapshots
      • The Snapshots page
      • Viewing snapshots
      • Stack traces within the Snapshot
      • Accessing past snapshot data
  • Part 4: Multiserver Monitor, Admin API monitoring, and more
    • An enterprise dashboard with the Multiserver Monitor
      • Opening the Multiserver Monitor
      • Adding new monitors
      • Observing the status of a monitored server
    • Some possible challenges using the Multiserver monitor
      • Securing the monitoring of your server
      • Be careful with browser caching and the cross-domain file
      • Multiserver Monitor configuration is stored per the domain used to open it
    • Programmatic Monitoring with the Admin API
    • Tweaking the Monitor in the Settings section
      • The General settings tab
      • The Filter Settings tab
      • The Profiling Filter tab
      • The Aliasing tab
      • The Refresh, Reset All Statistics buttons
    • Miscellaneous aspects of the Monitor
      • Flash Remoting must be enabled
      • Start settings remain enabled
      • Monitoring even when the server is becoming unresponsive

I hope you'll see from the above that there could be much more to the CF monitor than you may have realized. Each of the subsections often has lots of useful tips, tricks, and traps that I've observed over a year of use in both development and production.

And though I make the point in the articles, I'll repeat that some of the features come with zero overhead. I've blogged about that before. Don't let people tell you never to use it because it will harm your server's performance. As I say in each of the above, it's only the "Start memory tracking" button (one of 3 at the top) that could be trouble (and maybe "start profiling", but to a much less worrisome extend). But you don't even need to use the 3rd (and least obtrusive button) "start monitoring" to get a lot of great value from it. I stress more about this in parts 1 and 2 of the series.

What about FusionReactor and SeeFusion?

Of course, my support for the CF Server Monitor doesn't diminish my enthusiasm for alternatives like FusionReactor and SeeFusion, nor do I see one replacing the other as I've written about before. Each does something the other may not do, and I see value in each of them (and even have recommended running more than one at a time to solve certain problems).

See my corresponding blog categories on these, at the right, to find more entries on FR and SF, as well as the CF8 Server Monitor.

I just want to help people make the most of whatever monitor they use.

Available for Consulting Help as well

I'll throw in, as well, that if you need help using any of these tools, or doing any CF server troubleshooting, I'm available for consulting help, whether online or on-site, for as little time as is needed to help solve the problem. See my consulting page for more information. I've helped many organizations, large and small, resolve nagging problems, using either (or none) of these monitoring tools.

Feel free to contact me any time to pose a problem related to performance, stability, or similar errors or problems, and I'll let you know if it's something I can help with.

Averse to reading 45 pages online? you don't need to

For those who don't fancy the prospect of reading 45 pages of content online, note that I'm referring to the page count as it would be if you printed the available "printable version" (offered on all DevCenter articles). You can use that feature yourself to obtain a single long HTML page for each article, and then if you want you could print that out. (And if you use features in your printer to print multiple pages to a side and 2-sided, as I discuss here, you can fit it all in just a few pieces of paper!) (Update: tipicalcharlie domain is no more, but page recovered using Archive.org.)

I'll add that for those who prefer watching over reading, I've also given presentations about the monitor at several conferences and user groups (some available as online recordings), which you can find at my presentations page.

Vista (and Win 2008) now offers option to delay autostart of services

Note: This blog post is from 2008. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
I just noticed the other day that Vista (and Windows 2008) offers a new option for starting services: Automatic (Delayed Start). This is a pretty important (and for me, long-awaited) feature, whether in development or production. If you've ever felt that too many services were contending with each other as they all tried to start immediately on a restart, this is the solution.

According to various Microsoft resources I've found, such as this, the way it works is that delayed services start after those set to automatic have finished starting. Furthermore:

...it sets the priority of their initial thread to THREAD_PRIORITY_LOWEST. This priority level causes all the disk I/O the thread performs to be Very Low I/O priority. After a service finishes initializing, the Service Control Manager sets its priority to normal. The combination of the delayed start, low CPU and memory priority, and background disk priority greatly reduce interference with a user's logon. Many Windows services, including Background Intelligent Transfer, Windows Update Client, and Windows Media® Center, use the new start type to help improve the performance of logons after a boot.

As you can see, they set various Windows services to use this by default. So, should you use it? And in development or production?

Could be great for development

I can see it being very useful in development, especially. Imagine you want to have certain services running (like CF) but you don't care if they start immediately. Setting them to delayed means your machine can start up faster, and when you do eventually need what the service offers, it should be running.

(Yes, I realize you can start CF manually from the command line instead, and some may prefer that as their means of running CF in development. That's not the point here, though. And I also realize one can even start any window service via shortcuts as well, so as to start them manually. I use that to stop and then start them (rather than open services to restart them if I do it often, as I might with CF during development). I'm still not preferring to run CF from the command line by default, so let's let that debate go. )

I'm just saying that if you do want CF or other services started as services, but you don't really need them running immediately on restart, this seems a good option.

For now, I've enabled it for my two CF services (7 and 8), and their related search and ODBC services, and SQL Server and related services (I've already set MySQL and Oracle to start as "manual" as I use them less frequently), and IIS (world wide publishing service).

Any drawbacks? Time will tell

I say above that it "seems a good option" and "could be great" (and I mention it for development primarily) because I could see a possible problem where the lower disk, cpu, and memory priority could have some unintended consequences if in fact CF requests were to start coming in immediately upon start of CF. Again, perhaps in development this isn't an issue but it's something to keep in mind--and especially for production.

I could just see some admin deeming CF perhaps to be "not as important" as some other services on the machine and so they might set CF for this delayed start. If they don't realize this throttling that happens during service startup in this mode (and its not obvious), I could see it causing problems.

I'll say this bears paying attention to for any who perform troubleshooting on a CF server, if there are any problems during startup. It will now be one of the first things I look into when someone reports problems with CF on startup.

(I won't go so far as to suggest it's had anything to do with the problems some have had with initialization of CF due to JVM 1.6. Since it seems those were indeed solved by going back to 1.5, it doesn't appear it could have been due to this instead.)

There are some other interesting new features in Vista and 2k8 regarding services, especially "Preshutdown Notification". I may write more about those in a future entry.

And if anyone would want to snipe that their OS has long had features like the above, please, save it. :-) I'm here to help those who want or have to choose to use Windows. This isn't the place to try to evangelize them away or to carp about how they are or have been missing out. Thanks.

What it means if you install Windows Search 4 and get "update does not apply"

Note: This blog post is from 2008. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
I saw a recommendation on a favored site of mine to consider updating Vista SP1 to use Windows Search 4. I got it from the MS site for Search 4 and tried to install it, but it failed getting "update does not apply". I dug around and could find no apparent answer, but figured it out. Turns out it was installed as part of a Windows update just the other day.

I recall now seeing it mentioned in the update (I always have Windows tell me what updates it has before installing them), but just had forgotten it. Anyway, the MakeUseof entry says that indexing should be a lot faster. That's good to hear. I had disabled the search for a while when I noticed it stealing a lot of resources (and yes, I know of Google Desktop and others, and they all can have that problem).

Anyway, just wanted to post this here in case others search for a solution to this problem. If you're getting this error, check if you already have it installed (either using "control panel>windows update>view update history" or "control panel>programs and features>view installed updates" and sort it by name to find if Windows Search 4.0 is listed and when it was installed (right-most column).

What is the FusionReactor datasource monitoring feature? Why would I use it? Powerful stuff!

Note: This blog post is from 2008. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
As I wrote my previous entry on FR over the weekend, I got to thinking that some readers (whether new to FusionReactor, or using it but unaware of the datasource monitoring setting I mentioned) might benefit from a little more information about the FusionReactor's datasource monitoring feature.

What is the datasource monitoring feature? Why would I use it? Powerful stuff!

The datasource monitoring feature, referred to in the docs as the "JDBC wrapper", is a low-overhead way to configure FusionReactor so that it captures information about each query (against a given datasource), for every request, in detail and in aggregate. It captures and reports:

  • the SQL statement (including CFQUERYPARAM values)
  • the execution time (time spent in the database, and time spent getting it from the database to CF)
  • the number of rows returned
  • the CFML template and line of code where it was executed
  • and more

This query information is tracked per request and also in aggregate across all requests (in the graphs in the Enterprise Dashboard and System Metrics pages, the Longest JDBC page, and other places.)

It's really powerful information to have when you're trying to understand why and how your page, application, or server it performing.

You can see more about using the information in these feature focus pages at the FR site: What are System Metrics? and Resource Graphs, among others.

As I said in the last entry, you can learn more about setting up the FR JDBC wrapper feature (including the simple steps on how to implement it--which have been updated in the FusionReactor 3 docs) in the Tutorial (pdf) and User Guide (pdf).

What's the overhead of this datasource monitoring? What's it doing?

That's a natural and reasonable question. The folks at Intergral (makers of FusionReactor) say that it's very low overhead, and they've done considerable testing (millions of requests before each release) to confirm it.

Maybe it would help to understand how it works. It's quite simple, really. When you configure a datasource to be wrapped (per the instructions pointed to above), you're basically just implementing an alternative JDBC driver (FusionReactor's) to literally "wrap" the driver that was being used originally by your datasource.

Your code continues to use the same Datasource Name, but the change of the datasource causes CF to pass the SQL first to the FusionReactor JDBC wrapper, which takes note of the starting time, the SQL statement, etc., and then passes it the query on to the real (original) database driver. That then passes it to the DB, and gets the result, and before it's passed back to CF, it goes back through the FusionReactor wrapper, which notes the execution time, recordcount, etc.

So you see, the wrapper is really quite lightweight. It's just an observer, watching what's going to and from the database. The info is then written to FusionReactor's JDBC log (if enabled) and stored in FusionReactor's small memory space for presentation in the various interfaces that show JDBC status information. Again there's more about this in the documentation.

Some other tips on the JDBC Wrapper

To see information on what queries were executed (if the datasource was wrapped), see the bottom of the request details page (for either a running request or the request history page). Further, note the available JDBC tab in that request details page. That will show each SQL statement and the details (time, count, etc.). The bottom of that page will also show counts and averages for all the queries in that request.

You'll see at the bottom of that page that you can also configure the JDBC settings page to restrict how many queries are shown in the JDBC request details, and you can limit it to only those exceeding a certain amount of time, as well as whether to show them in chronological order or executiontime order.

I'll note as well that if you do implement the JDBC wrapper feature, you'll probably want to enable JDBC logging, which is disabled by default. This writes all the detail above to a log file, for each SQL statement, which can be great for either post-mortem analysis (after a crash) or for trend analysis (perhaps across several restarts). You can choose to limit the logging to queries slower than a set number of milliseconds (separate from the control above about what queries to show in the request detail page.)See the JDBC>JDBC Settings option in the left nav bar of the FR interface.

The wrapper configuration for each DSN itself also offers still more features that many miss, so check out the docs. The Tutorial concludes with an example of using the rowlimiter feature to put the brakes on a rogue page, while the user guide details this and all the available features of the wrapper.

Learning more about FusionReactor

For more on FusionReactor in general, see their web site or my past blog entries on it.

(And yes, before anyone else would point it out in a comment, both the CF 8 Server Monitor and SeeFusion also provide this sort of JDBC query information. In the CF 8 Monitor, it's built-in (no need to configure the DSNs at all). And in SeeFusion, there's no need to manually configure each DSN, as there's a one-button configuration option. Intergral are said to be working on something similar for a future release of FR, so some of the concepts above apply across the monitors.)

FusionReactor works with ColdFusion Standard and Enterprise in version 6, 7, and 8, as well as Railo, Open BlueDragon, and BlueDragon/J2EE, and indeed any J2EE application server or Servlet engine. (BTW, technically, the term J2EE has been obsoleted by the more version-neutral Java EE or JEE. So many things in CF docs and related tools still refer to it as J2EE simply because most CFers aren't paying that close attention to such details, so there's been little motivation to make the clarification.)

PS: Why is it called the JDBC wrapper feature, instead of the datasource monitor?

That's an interesting question. It might feel a little clumsy calling it the JDBC wrapper. I wonder sometimes if CF users may miss the feature. Hopefully the explanation above about how it works helps. But you may wonder why it's not called the "datasource monitor", which might be friendlier for CFers.

But here's the thing: as I said a moment ago, FusionReactor is not JUST a CF server monitor. It can be used by any J2EE server or servlet engine. And not all J2EE app servers would use a concept of a "datasource".

Consider a Tomcat developer who might write a servlet or JSP that calls a database. They could leverage this JDBC wrapper feature (and all of FusionReactor's features) just as readily, though instead of changing the configuration of a datasource they would modify the JDBC URL in their code or a config file. That said, there are some J2EE servers that do use JNDI datasources.

So the makers of FusionReactor (Intergral) have to walk a bit of a fine line about labeling features in a way that might apply only to CF.

It's amazing, really, that one might not otherwise have any reason to notice that the product is designed to be used by either CF or J2EE shops. Most of us think it's just a CF monitor. It's much more.

And BTW, it's licensed per server, so you can install it on as many engines as you have (that it can monitor) on a single machine. In fact, you can even configure a free Tomcat engine just to be a monitor of other FusionReactor (Enterprise) instances.

This is something that Intergral is now offering (in beta) as a new packaging of the tool as "FusionReactor Enterprise Monitor - FREM". You can get it (or learn more) at their Fusion Labs site. I'll have more on that in a later entry.

Glenda's Obituary

Note: This blog post is from 2008. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
Following up on my note from Saturday, Mourning the tragic passing of Glenda Vigoreaux, trainer/speaker on CF and more, I just received a copy of the obituary her husband has written (from Ben Forta, to whom he'd sent a copy):

Dear Friends

With the greatest sorrow a heart can withstand, I regret to inform you that my beloved wife, Glenda Vigoreaux has passed into the arms of our loving God. Her courageous battle with anxiety and insomnia ended the morning of Tuesday, July 15, 2008.

Glenda is survived by her adoring husband Paul Hacker, mother Lydia Echevarria, sister Vanessa Vigoreaux, brother Luis Echevarria and a host of family and friends who also loved her dearly. At last she has the peace for which we've prayed, as she sings with a choir of angels.

Glenda has been honored in a ceremony attended only by immediate family. The final resting place for her cremated remains is yet to be determined. Memorial donations may be sent to St. John's Lutheran Church, 7205 North 51st Avenue, Glendale, Arizona 85301. Please forward this message as appropriate. My apologies to those I may have forgotten.

Each of us who met her are blessed to have encountered a loving soul, unique in the world. Her concern and respect for each individual were genuine. Glenda trusted that in giving of her many talents, she brought out the best in good people and was thereby enriched herself. She was an inspirational angel among us.

Please join my prayers celebrating her life and honoring her example as an extraordinary human being. Remember her as I will, full of life and love.

Good night sweet Angel. Te amo.

Paul A. Hacker

If you'd like to comment, please provide them instead in the previous entry. Let's regard it as a memorial roll for her from our community and others (lots of nice comments there already).

Mourning the tragic passing of Glenda Vigoreaux, trainer/speaker on CF and more

Note: This blog post is from 2008. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
I'm sorry to break the news, but I've not seen anyone else blog about this. Some of you may have known Glenda Vigoreaux, a widely acclaimed trainer and speaker in the CF and broader Adobe world. Sadly, she was found dead in her Glendale AZ home earlier this week, of unnatural causes.

I'll have more on that in a moment, including more about her surprisingly storied past (entirely unrelated to training and speaking) that may be a surprise to some (it was for me).

But first I'd like to remember her as I knew her.

Glenda, the acclaimed trainer and speaker

Glenda was an Adobe Certified Master Instructor who had taught Adobe/Macromedia technologies starting in 1998, including ColdFusion, Dreamweaver, Captivate, Contribute, Acrobat Connect and Presenter. She was widely praised and received consistently high marks, working for Roundpeg in Arizona (since 2005) and who before that had been on her own as GVX Technology since 1996.

Glenda was an equally lauded and popular conference speaker, winning best speaker honors at Max 2004 and CFUnited 2005 (we tied that year). You can find a podcast of her 2006 talk on CF printing and Reporting as well as her CFUnited bio of that year. You can learn more of her professional history from her LinkedIn page. She was even a speaker on the ColdFusion Meetup in May 2005, when Steven Erat was hosting.

Suicide? Glenda?

The most tragic thing about the news is that her death has been ruled a suicide. I just can't fathom that. Besides the accolades above, anyone who knew her would say that she would seem one of the very last people in the world you could ever expect of being driven to that. In fact, if you look at the about page of her GVX site, you see that she had a clear passion for life, and for others.

Of course, I'd not talked to her in a couple of years, and naturally people's personal lives can often be masked by their public persona. Indeed there was much more to her background than many may have known (I didn't). I learned of her death today in an email from Steve Drucker (for which I'm so grateful). In it, he pointed to a news article (translated from Spanish).

The story reports that her husband found her with a gun at her side, with the "forensic and physical evidence...consistent with a self-inflicted shooting". I didn't know her husband, named there as Paul Hacker.

She came from a famed family, tragically notorious in Puerto Rico

But in that story (and with additional details found in sources mentioned later here), we learn that in fact Glenda came from a background of both notoriety and family tragedy. I never knew that hers was a celebrity family in Puerto Rico. Not only were her father and mother famous there as a TV producer and actress, respectively, but tragically, her father was brutally murdered and her mother convicted of it and jailed for 13 years. Apparently, all this was big news in Puerto Rico.

Indeed, the wikiepedia entry on her mother has even already been updated to reflect Glenda's death, and her death is listed as well in Wikipedia's 2008 deaths page with references to her notable family members, all this just 3 days later as I write. Again, clearly this was significant news to some people.

As further sad testament to the notoriety of all this, the news article above even says her house in Glendale and her family's in PR were both "full of paparazzi" (representing Puerto Rican press, I'd suppose).

I was almost tempted to doubt if we were talking about the same person, since these things all referred to her as Glendaly Vigoreaux Echevarría (the latter being her mother's famed last name). But then I found this memorial page which had that same "Glendaly" name but with happy pictures of her. Yep, that was the Glenda we knew.

A one-time TV star in Puerto Rico

The page goes on to offer still more about her family, their tragedy, and her life. It says that she herself had been a child TV star and later host, comedienne, and singer with her sister Vanesa on Puerto Rican TV shows.

That doesn't surprise me. She was certainly so full of life, which makes this all the more surprising.

R.I.P., Glenda

So today we remember the passing of a member of the CF community, a stellar trainer and speaker, mystified by the asserted cause of her death...while a segment of the celebrity gossip world instead regards it only as another tragedy for a notoriously troubled celebrity family. It just doesn't make sense.

She will be sorely missed.

Using FusionReactor's datasource monitoring feature? Here's a tip

Note: This blog post is from 2008. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.
If you're using FusionReactor, and you set up a datasource to be monitored by it (the "JDBC wrapper" feature), did you know that you can configure it so you can see the datasource name for each query in the request details? A lot of people seem to miss it, so I wanted to point it out.

You just need to add the string:

;name=dsnname

to the end of the JDBC URL that you configure (per the instructions). For instance, for the wrapped version of my AdventureWorks SQL Server DB, I use:

jdbc:fusionreactor:wrapper:{dbc:macromedia:sqlserver://localhost:1433;
databaseName=adventureworks;SelectMethod=direct;
sendStrinParametersAsUnicode=false;MaxPooledStatements=1000}<strong>;name=AdventureWorks</strong>

That all goes on one line, of course, but I didn't want it to mess up the display in some browsers.

You can learn more about setting up the FR JDBC wrapper feature (including the simple steps on how to implement it--which have been updated in the FusionReactor 3 docs) in the Tutorial (pdf) and User Guide (pdf).

If you're not familiar with the datasource monitoring feature, I'll share more about it in a follow-up entry.

More Entries

Copyright ©2025 Charlie Arehart
Carehart Logo
BlogCFC was created by Raymond Camden. This blog is running version 5.005.
(Want to validate the HTML in this page?)

Managed Hosting Services provided by
Managed Dedicated Hosting