AOP in the database

A good friend of mine is an excellent Oracle Trainer / Consultant. I noticed an article on his blog about rewriting queries on the fly. Quite interesting stuff. Similar to method interception in Aspect Oriented Programming, a query can be substituted over another in real time.

Like it or not, there are millions upon millions of lines of software code where values and rules are hardcoded. Using DBMS_ADVANCED_REWRITE isn't for the feint of heart. If a system had embedded or hard coded rules and needed to change over to a new set of rules, this technique could help ensure compliance and speed up the development time.

Should a system be built around this method? Certainly not, but if a legacy system needs to be updated quickly and accurately, this technique is gold in the right hands.

Steve Karam explains: Trick 2 Rewrite a Query At Runtime

5155 Views Print Print Comments (2) Wow

Field is a reserved word in cfqueryparam

A workflow application I recently worked on tracks workflow between two groups, a legal group and a group working in the field. I aptly named the groups "legal" and "field".

This turned out to cause problems when using cfqueryparam. The column was a varchar column so I would imagine the text 'FIELD' would be just another string of text

Instead:

view plain print about
1Macromedia][SQLServer JDBC Driver]Unsupported data conversion.
2
3SELECT TOP 1 TimeCardID, ObjectID, UserID,
4UserType, DateTimeIn, DateTimeOut, DateCreated FROM
5TimeCard WHERE ObjectID = (param 1) AND UserType =
6(param 2) ORDER BY DateCreated
7
8
9(param 1) = [type='IN', class='java.lang.String',
10value='72FAE9F0-16D4-3001-353F84B2E749664D', sqltype='cf_sql_varchar']
11, (param 2) = [type='IN', class='java.lang.String', value='FIELD',
12sqltype='cf_sql_varchar']

I had no problem using the value 'FIELD' in the same column without cfqueryparam. It would seem something inside cfqueryparam must gets unhappy with the text string 'FIELD'

view plain print about
1SELECT TOP 1 TimeCardID, ObjectID, UserID,
2UserType, DateTimeIn, DateTimeOut, DateCreated FROM
3TimeCard WHERE ObjectID = (param 1) AND UserType =
4'FIELD' ORDER BY DateCreated
5
6
7(param 1) = [type='IN', class='java.lang.String',
8value='72FAE9F0-16D4-3001-353F84B2E749664D', sqltype='cf_sql_varchar']

Note: The word 'field' doesn't appear in the MSSQL Reserved word list nor in the SQL Reserved words checker by the illustrious Pete Freitag. Thusly, I believe this is specific to cfqueryparam only.

Flex Mouse Events, Effects and functions

While adding some effects to a flex application, I noticed some strange behaviour. All of a sudden I noticed a function I had set to fire on the click event of a button was no longer firing.

I originally thought the effect intercepted the call in some way, but it turns out I had the effect set to fire on the mouseDownEffect. Changing the effect to fire on the mouseUpEffect brought the function back in to play.

A mouseDownEffect apparently changes the button before the click event fires. Hope this helps someone.

This is bad

view plain print about
1<mx:WipeLeft id="aWipeEffect" duration="1000" />
2<mx:Button label="Change More Text" click="changeText();" mouseDownEffect="aWipeEffect" />

This is good

view plain print about
1<mx:WipeLeft id="aWipeEffect" duration="1000" />
2<mx:Button label="Change More Text" click="changeText();" mouseUpEffect="aWipeEffect" />

4830 Views Print Print Comments (0) Flex

Flex Builder and CFMX RDS

Just a public service announcement for those using Flex Builder. Flex Builder really enjoyes defaulting to port 8500 at all possible turns. I was playing with the RDS extentions and couldn't get the server to connect. RDS was ( in fact ) enabled in the CFadmin. I changed the RDS password a few times and still had no connection. Turns out the default connection was to our friend port 8500. I found the configuration information in the helpful Flex Builder docs. The RDS configuration was tucked away in window/preferences. When creating a Flex project the docs say:

view plain print about
1To configure any ColdFusion servers that you want to connect to using RDS:
2In Flex Builder or Eclipse, select Window - Preferences - RDS Configuration.
3To configure the default localhost server, select localhost and specify the following:
4Description
5Host name (127.0.0.1)
6Port number (8500 if you are using the built-in web server)
7Context root, if necessary

Once the port was switched to port 80, I was in business. I want to do a full evaluation of the wizards available in Flex Builder. Dean Harmon has published three Adobe Connect sessions on Flex / CF wizards. I am going to give them a go and post my experiences later on this weekend.

Why I love Flex

Over the last 10 or so years, web based applications have used HTML. HTML describes the look and feel of the application to the web browser, a piece of software on your local computer. The web browser then interprets the description into a usable ( you hope ) application capable of interacting with users.

This process has worked extremely well, mostly for lack of viable alternatives.

[More]