Adobe Solution Partner

June 8, 2009

SeeDSN – A JDBC Wrapping Tool For Use With SeeFusion

Filed under: ColdFusion, General Development, SeeFusion — Tags: , — Tyson Vanek @ 3:53 pm

Introduction

SeeDSN is utility that I’ve been using internally with our SeeFusion customers for years in order to assist with configuring JDBC wrapped datasources that can be monitored via SeeFusion.  The utility was originally developed for Webapper by Daryl Banttari, but it was never officially released to the public – until today.  Recently I was on location with a Webapper customer in New Mexico assisting with installation and configuration of SeeFusion when the lead technical resource, Robert Aguayo, suggested the idea of integrating SeeDSN directly into the ColdFusion Administrator interface.  It was Robert’s suggestion that motivated me to revisit the utility, clean up some of the technical aspects, and publicly release it as a ColdFusion Administrator extension for SeeFusion users/customers.

What is SeeDSN?

SeeDSN is a web-based administrative utility for use with SeeFusion.  Using SeeDSN, administrators of ColdFusion instances configured with SeeFusion can easily wrap/unwrap datasources with the JDBC wrapper required for reporting query information within SeeFusion.

Main Features

  • One-click functionality of backing up an existing ColdFusion datasource before applying the JDBC wrapper required for proper reporting to SeeFusion.
  • One-click functionality of restoring ColdFusion datasources to its original unwrapped configuration and removing the JDBC wrapper.
  • Form-driven configuration of additional JDBC connection string arguments relevant to datasources wrapped for use with SeeFusion.
  • Ability to verify datasources in the same manner that they are verified from the ColdFusion Administrator Datasources page.
  • Integrates SeeDSN and SeeFusion directly with your existing ColdFusion Administrator interface.

 

Requirements

  • ColdFusion 7+
  • SeeFusion

 

Installation

First, you’ll need to download the distribution here (http://www.seefusion.com/seedsn_v1.1.zip).  Once you’ve downloaded it, you’ll need to open it up and follow the steps below.  These directions can also be found in the readme.txt file bundled with the distribution.

  1. Copy the “seedsn” folder in this archive directly to your /CFIDE/Administrator/ folder. 
    This means that when you’re finished, you should have a new “seedsn“ folder in your
    /CFIDE/Administrator/ folder (i.e. /CFIDE/Administrator/seedsn/).
  2. If you’re using ColdFusion 8+, move “/CFIDE/Administrator/seedsn/custommenu.xml” to ”/CFIDE/Administrator/custommenu.xml“.
  3. If you’re using ColdFusion 7.*, move “/CFIDE/Administrator/seedsn/extensionscustom.cfm” to ”/CFIDE/Administrator/extensionscustom.cfm“.
  4. Edit “/CFIDE/Administrator/seedsn/Application.cfm” and replace the value of the “request.urlSeeFusionRedirect” variable with the fully-qualified URL to your existing SeeFusion Flex dashboard interface.

That’s it!  You’ve just installed SeeDSN, and now you can access it directly from your ColdFusion Administrator.

Using SeeDSN

Once you have completed the steps outlined above, you’ll be able to access both SeeDSN and SeeFusion directly from within your ColdFusion Administrator interface.

Simply fire up your preferred web browser and log in to your existing ColdFusion Administrator.  Once you’ve logged in, you should notice a new group of menu options towards the bottom of the left-side navigation menu.

ColdFusion 8+
You should see a new navigation menu section labeled “SEEFUSION” which, when expanded, contains two links.
- “Flex Dashboard” will link to the SeeFusion Flex dashboard as indicate by the URL you supplied during step 3 above.
- “Datasource Wrapper” will link to the SeeDSN JDBC wrapping utility that will assist you with your datasource wrapping needs.

ColdFusion 7.*
You should see a new navigation menu section labeled “CUSTOM EXTENSIONS” which, when expanded, contains two links.
- “SeeFusion Flex Dashboard” will link to the SeeFusion Flex dashboard as indicate by the URL you supplied during step 3 above.
- “SeeFusion Datasource Wrapper” will link to the SeeDSN JDBC wrapping utility that will assist you with your datasource wrapping needs.

May 29, 2009

Perry Woodin Joins Webapper!

Filed under: ColdFusion — Nat Papovich @ 3:36 pm

We’re very excited to announce yet another big notch in our Web application engineering belt – Perry Woodin joined Webapper early this month. Whereas our recent hire of Steven Erat has contributed greatly to our ColdFusion Tuning & Troubleshooting services, Perry brings an altogether different set of skills to our Application Development services, and will be leading development projects.

Having worked with ColdFusion since version 2.0,  he co-authored “Discovering Fusebox 4 with ColdFusion” while working on a range of business and commercial web applications ranging from eCommerce apps to specialized internal systems for everything from art galleries to industrial manufacturers. Additionally, he has significant Flex development under his belt (his latest application made Laptop Magazine’s Top 50 Web Applications of 2008), which we’ll be putting to good use in very short order.

We couldn’t be happier about adding Perry’s talents to our team of Web application engineers. Welcome Perry!

May 12, 2009

Charity Code Jam Is A Go!

Filed under: Conferences — Tags: , — Shannon Hicks @ 3:18 pm

We’re happy to announce that, with the help of the dynamic duo from 360|Conferences, the Charity Code Jam is going to happen at 360|Flex in Indianapolis. After reading their blog post, we talked it over and decided this was another excellent way to spread good karma around.

Ali Daniali has plane tickets in hand now, and we’ll lend a hand setting up the spaces donated by 360|Flex so the coding can begin on Monday, May 18. Coding will continue 24 hours/day until we’re done, and there will be copious amounts of caffeine and food. So bring your laptop and plenty of sleep before the conference, and help make a difference for The Leukemia & Lymphoma Society. Webapper is honored to be pitching in with some dollars to support such an incredible effort in giving back.

May 5, 2009

CreateUUID() : Friendly Function or Server Killer?

Filed under: ColdFusion, JVM & Java, Performance, SeeFusion, Windows — Tyson Vanek @ 1:29 am

Ok, so I know what you’re thinking.  You’re thinking I must be crazy for suggesting that a simple built-in unique randomization function could somehow be instrumental in crashing a ColdFusion server, right?  Well, before you go calling me a lunatic, let me assure you that the ColdFusion createUUID() function DOES, in fact, represent a threat to the stability of your server – and I intend to prove it to you.

Before I go too far into this topic, I should point out that this threat really only exists if you happen to be running ColdFusion on a Windows server.  For those of you who are running on any sort of *NIX-based server, you can move on – nothing to see here.

If you’re still with me at this point, then I need to do a little explaining.

First off, you should be aware of a known issue with ColdFusion on Windows servers as documented in this Adobe TechNote article.  This TechNote basically explains that there’s a bug with certain JVM versions under the hood of ColdFusion that results in the potential for the createUUID() function to actually increase the speed of the system clock within Windows.  Now, this acceleration of the Windows system clock is only likely to occur in situations where createUUID() is “heavily utilized”.  The tricky part here is that I’m not entirely certain how “heavily utilized” is classified as referenced in the TechNote.  Later in this article, however, I will give you an example of a particular customer scenario that was creating this server-crashing behavior as a point of reference.  For now, just note that heavy usage of the createUUID() function might cause the Windows system clock to speed ahead a matter of seconds or even minutes within the span of an hour or two depending the volume with which the function calls are made.

Now, the second vital bit of of information comes down to the inner mechanics of how the createUUID() function actually works.  The function more or less generates a unique hash/GUID based on a combination of the server machine ID, a cryptographically strong random number, and the present date and time.  Now, we all know that calls to the createUUID() function on the same server will all have the same machine ID input value.  And even though the chance is extremely slim, fact remains there’s a fraction of a fraction of a chance that two calls to generate a “cryptographically strong random number” could result in returning the same value.  That’s where the importance of the present date and time consideration made by createUUID() becomes important.  If you think about how quickly many ColdFusion templates execute (quite often literally within milliseconds), you can quickly see how a series of calls to simply get the current server date and time (even if to the precision of milliseconds) might return the exact same date and time.  For this very reason, the createUUID() method makes a call during its execution to another internal method – uniqueTOD().  The purpose of uniqueTOD() is to return a Unique Time Of Day – as the name suggests.  But as we already discussed, it’s possible that extremely rapid calls to return the system date and time may not be separated by more than a millisecond, resulting in a return of the same date and time.  So, in order to ensure that this doesn’t take place, the uniqueTOD() function has been designed as a “synchronized” method.  In the Java world, that just means that the method is single-threaded – it can only be run one invocation at a time, and any attempts to invoke it while it’s already in the process of running will be blocked until execution of the running invocation completes.  In addition to this, the uniqueTOD() also includes a Thread.sleep(1) statement which effectively causes the thread to sleep for 1 millisecond by designating a specific date and time at which to wake and resume execution.  The combination of these two concepts ensures that dates and times returned by the uniqueTOD() function will always be separated by at least 1 millisecond.

If you need proof that this takes place, take the following bit of sample code, toss it on your server, enable server debugging output, point your browser at it, and take a look at the execution time spent.

<cfloop from="1" to="1000" index="i">
    <cfset x = createUUID()>
</cfloop>

When you run this code, you’ll quickly notice that the execution time takes roughly 1 second or 1,000 milliseconds in direct correlation with the to argument value of 1,000 for the cfloop.  This correlates directly to the 1ms sleep time being incurred with each of the 1,000 calls within the loop to createUUID().

So now that we understand all those mechanics, it’s time for me to unveil where this might become a server killing problem.  There’s a handy bit of operating system housekeeping that most of us take completely for granted these days – automatic internet-based time synchronization.  Consider the following scenario with me.

  • Your server starts off at 1:00:00.000pm with a date and time that are synchronized to an internet time server of some sort.
  • Your ColdFusion application makes “heavy utilization” of the createUUID() function over the course of 2 hours, gradually advancing your server clock by 200 seconds or so as a result of the behavior/bugs I’ve explained above.
  • Your ColdFusion server is in the middle of a series of high-volume calls to the createUUID() function.
  • Your server makes a call to the configured internet time server, realizes the system clock is currently running about 200 seconds fast, and resets the system clock appropriately to 3:00:00.000pm.
  • As the system clock was turned back to the proper time, a single internal call to the uniqueTOD() function had already assigned a “wake time” of 3:03:20.001pm (based on having previously been 200 seconds ahead).

In the scenario outlined above, you now have a createUUID() call waiting on an internal uniqueTOD() call that won’t actually complete execution until 3:03:20.001pm.  Prior to the call to synchronize the system clock with the internet time server,  this would have only been 1 millisecond away.  But now that the server clock has been corrected, we’re suddenly 3 minutes, 20 seconds, and 1 millisecond away from that “wake time”.  And what makes matters worse is that the waiting uniqueTOD() invocation is also synchronized.  This means that all other invocations to uniqueTOD() or to any other functions that include the use of uniqueTOD() must now sit and wait until the running/waiting invocation “wakes” and completes at 3:03:20.001pm.

Wait a minute.  What’s that I hear in the background?  Oh, yes… that’s the sound of thread activity grinding to a halt on your production server as threads are suddenly being blocked for 3 minutes, 20 seconds and 1 millisecond until that uniqueTOD() invocation finally wakes and completes in order to generate that UUID that was requested.

I actually tracked this situation down for a Webapper customer who had been experiencing frequent yet unpredictable “mystery crashes” of their ColdFusion instances.  Our customer was very technically proficient and had already looked under most of the “rocks” we would typically turn over in this sort of situation.  During our initial kick-off call with the customer, we were all in consensus that this was likely a result of some sort of database transaction locking and blocking that we’d need to track down.  After a little investigation and profiling on the servers in question, I realized that was simply a red herring.  With the help of SeeFusion, we were able to snag stack traces from the server as the crashes were actually taking place and quickly determine that the entire system was hanging up WAY before ever getting to any database activity.  In fact, the application seemed to be hung on the first line of their Application.cfm file – the <cfapplication> tag.

That’s when it hit me.  The customer’s application was architected in such a way that there were very high-volume rapid-succession web service calls being made to a ColdFusion component.  By high-volume rapid-succession, I specifically mean 2 or 3 calls every 50ms.  That component, by design, was including the root Application.cfm file.  And the <cfapplication> call was hanging because the clientmanagement argument had been set to “true” and the customer had enabled the “Use UUID for CFTOKEN” checkbox in the ColdFusion Administrator.  Each web service call was resulting in the assignment of a new CFID/CFTOKEN pair – an entirely separate blog-worthy issue.  Suddenly, the whole situation made perfect sense – well, at least in theory.  The real test, of course, would be to have the customer uncheck the “Use UUID for CFTOKEN” setting and see if the “mystery crashes” came to an end.  I’m happy to report that they haven’t had a system hang since disabling that ColdFusion setting.

So, if you have any code in your server that might be creating opportunities for high-volume utilization of the createUUID() function, then you just might be one internet clock synchronization cycle away from a complete ColdFusion meltdown.

April 30, 2009

Steven Erat Joins Webapper!

Filed under: ColdFusion, Flex & Flash, Miscellaneous, Performance — Patrick Quinn @ 12:42 pm

We’re happy to announce another big notch in our Web application engineering belt–Steven Erat joined Webapper last month! Steven has spent the past decade of his life as a senior member of the ColdFusion engineering and support divisions at Allaire/Macromedia/Adobe. Most recently at Adobe he was an engineer on the Flex SDK team. Unless you’ve been living under a rock somewhere, there’s a very high likelihood that you’ve read his great talkingtree.com blog at some point (and keep your eyes peeled here for more of those kinds of contributions on the Webapper blog).

Steven will be working primarily in two practice areas for us–our popular ColdFusion TNT services, and our SeeSoftware products practice. We couldn’t be happier about adding Steven’s talents to our team of Web application engineers. Welcome Steven!

April 20, 2009

Shan’s Simple Examples: Setting properties of custom components

Filed under: Shan's Simple Examples — Tags: , — Shannon Hicks @ 3:34 pm

Someone in #cfflex on DALnet was asking about a custom component. They wanted to have a component that had two lists in it, where selections from the first list would filter the options in the second. They had a method written out that would do the comparison and filtering on the two lists, but they found that calling the method with the creationComplete event would return an error saying that one or the other property had no value.

The problem is that you never really know when or in which order properties will be set. The around this is to use getter and setter methods for your component’s properties:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import mx.collections.ArrayCollection;

private var _sourceData:ArrayCollection;
private var _targetData:ArrayCollection;

public function set sourceData(val:ArrayCollection):void {
    _sourceData = val;
    checkInit();
}

[Bindable]
public function get sourceData():ArrayCollection {
    return _sourceData;
}

public function set targetData(val:ArrayCollection):void {
    _targetData = val;
    checkInit();
}

[Bindable]
public function get targetData():ArrayCollection {
    return _targetData;
}

private function checkInit():void {
    if (_sourceData && _targetData) {
        // init this component here
        init();
    }
}

private function init():void {
    ...
}

These getter and setter methods are called whenever external code tries to get or set the property value, including if your external value is set with a binding. If I call my theoretical component with the following MXML,set sourceData()andset targetData()are called whenever dataIn and dataOut get new values:

<components:myComponent sourceData="{dataIn}" targetData="{dataOut}"/>

Both setter methods, after setting the passed value to private variables, call the checkInit() method. This method checks to make sure that _sourceData and _targetData are not null before calling the init() method.

April 9, 2009

Shan’s Simple Examples: Extending an object in Actionscript

Filed under: Flex & Flash, Shan's Simple Examples — Tags: , — Shannon Hicks @ 4:20 pm

The other day, someone asked me how they could re-use the code sample from Igor Costa’s post about getting the Rich Text Editor to output XHTML. Whenever you want to add functionality to an existing control, you just need to extend it. Here’s how:

Here’s the top bit of code from my XHtmlEditor.as file:

1
2
3
4
5
6
7
8
9
10
package org.iotashan.controls
{
    import mx.controls.RichTextEditor;
   
    public class XHtmlEditor extends mx.controls.RichTextEditor
    {
        public function XHtmlEditor()
        {
            super()
        }

The actual code where I’m telling the compiler that this object extends RichTextEditor is line 5. You can then see that in the constructor method, I call super() on line 9. The super() method just calls the original constructor of the RichTextEditor object.

From here, we define a getter and setter method for a property called xhtml. The xhtml property doesn’t actually store any value in our object, we just use it as an interface to the convertToXHtml() and convertFromXHtml() methods from Igor’s blog post.

12
13
14
15
16
17
18
public function get xhtml():String {
            return convertToXHtml(this.htmlText);
        }
       
        public function set xhtml(val:String):void {
            this.htmlText = convertFromXHtml(val);
        }

You can view the full working example here, and get the source here.

April 3, 2009

Mike Punsky Joins Webapper!

Filed under: ColdFusion, Miscellaneous — Patrick Quinn @ 1:25 pm

In our continuing quest for world domination, we’re continuing our torrid growth, and to help with that we’ve secured the services of yet another former Allaire-ian. The estimable Michael J. Punsky joined Webapper last month as our Director of Professional Services. And for those of you who’ve ever utilized our ColdFusion TNT services, you can probably surmise what this means. Demand is as high as ever for our ColdFusion consulting, so much so that we need a full-time, dedicated Director. And they don’t come any better-suited for this role than Mike. His computing career dates back to 1982, when computer dinosaurs roamed the earth, and the Internet was merely a gleam in Al Gore’s eye. After Macromedia acquired Allaire, Mike ran our consulting group for 5 years, growing it ten-fold in that time. Most recently, he headed up professional services for Brightcove (Jeremy Allaire’s current gig).

As many of you know, as a native Chicagoan, I love mafia metaphors. And Mike is a “made guy” in our part of the software world. We’re incredibly lucky and excited to have him here at Webapper.

CFUnited Express – Denver: WholeSum Performance

Filed under: ColdFusion — Patrick Quinn @ 11:08 am

If you’re in the neighborhood, this is a quick reminder that CFUnited Express Denver 2009 is this coming Monday, April 6. Here’s a link to register if you’re interested; it’s not too late!

http://express.cfunited.com/go/denver/2009/

My talk is called “WholeSum Performance: How To Build The Fastest Web Applications On Earth”, and our Co-Founder Mike Brunt is also speaking; his preso is on JVM Tuning. Both long-time Webapper specialties, of course! Here’s list of all the topics:

http://express.cfunited.com/go/denver/2009/topics

Hope to see you there. The Rockies are beautiful year-round, if you’re looking for an extra excuse to go!

March 28, 2009

Presenting at the Madison Adobe User Group

Filed under: ColdFusion — Shannon Hicks @ 4:58 pm

Just a note that I’ll be presenting at the Madison Adobe User Group meeting this Tuesday, 3/31. I’ll be presenting an intro to Flex/AIR/ColdFusion at American Family Insurance. More information is available on the Adobe Groups site: http://groups.adobe.com/posts/b5381e2718

Don’t forget to register if you’re coming!

Older Posts »