So ColdFusion 10 and ColdFusion Builder 2.0.1 update were released today. I'll move all our servers to 10 shortly but immediately I want to upgrade to Builder 2.0.1.
Well it's a little confusing you actually need to re-download the whole ColdFusion Builder 2 installer and re-install. As you re-install it actually uninstalled ColdFusion Builder 2 and updates to 2.0.1
It worked fine for me and all my projects and settings came accross.
Here is the link: http://www.adobe.com/support/coldfusion/downloads_updates.html#cfb2
Paul Kukiel - and what i'm interested in.
May 15, 2012
May 7, 2012
Sending Arrays from javascript to ColdFusion and Railo - The diferences
Wile attempting to answer a question on Stack Overflow I ran into an interesting difference between Railo and ACF
I've begun to use Railo more and more and this simple piece of code I expected would "just work". Well on Railo it did. On ACF it did not.
ACF sees the js array passed as a variable names "array[]" ( literally ) with a comma separated string as the arguments. Railo sees this as an array server side and treats it as such. See the results. ( not I have a cfdump is the ajax call using fire bug I can see the result of the dump of the arguments scope )
Railo:
AFC:
CFC:
CFM:
May 5, 2012
ColdFusion structs and case sensitivity
Typical use for structs in ColdFusion are:
The problem with this is the struct keys are case insensitive. Why is this a problem? Well it's not, not in CFML anyway but it is when you are passing data back to a ajax request and I have seen many people scratch there heads trying to work out why there ajax calls don't work. There solution is usually just to upper case the keys when they reference them in javascript. Well there is actually a different notation that I tend to use as demonstrated as follows:
The problem with this is the struct keys are case insensitive. Why is this a problem? Well it's not, not in CFML anyway but it is when you are passing data back to a ajax request and I have seen many people scratch there heads trying to work out why there ajax calls don't work. There solution is usually just to upper case the keys when they reference them in javascript. Well there is actually a different notation that I tend to use as demonstrated as follows:
Indexes are often forgotten
We have all worked on legacy code bases. One of the applications I work on is truly massive, occasionally some of the internal reporting tools have an issue running some of our reports, almost always it's because there is a query being looped and 1 or more queries being executed from within that loop. Now most of the time you can re-write a query like that but sometimes it's quite alot of work and when you have a 100 things on the go and you need the report immediately we may forget about the simple things.
Now in my case most of these issues are good issues to have, it means we have huge amounts of data, which reflect on the huge amounts of users and users ( in our case ) == $
In it's most simplest form the routines worked fine for lets say 10k users, but on 300k users the performance suffers exponentially. When I urgently have to fix an issue like this I look to the database find one of the inner queries, take a quick look and apply an appropriate index to that table. The most recent example went from timing out after 5 mins, to taking 9 seconds. With time I'll re-write that section of code to either appropriately use joins, or if required a storedproc with UDF's but int he mean time ~2 mins of setting up an index made my users happy.
Now in my case most of these issues are good issues to have, it means we have huge amounts of data, which reflect on the huge amounts of users and users ( in our case ) == $
In it's most simplest form the routines worked fine for lets say 10k users, but on 300k users the performance suffers exponentially. When I urgently have to fix an issue like this I look to the database find one of the inner queries, take a quick look and apply an appropriate index to that table. The most recent example went from timing out after 5 mins, to taking 9 seconds. With time I'll re-write that section of code to either appropriately use joins, or if required a storedproc with UDF's but int he mean time ~2 mins of setting up an index made my users happy.
May 3, 2012
How do you monitor your servers?
I monitor my servers in a number of ways. I've recently been using Pingdom as a quick and easy method of determining uptime and database response time.
Pingdom effectivly polls a URL on your server for an expected outcome and alters you if that outcome if different from expected. This simple piece of code does 3 things for me:
1. Alerts me to the server being up of down. If Pingdom cannot contact the server I receive an SMS notification.
2. Alert me if the database is not responding. If the query fails Pingdom is expecting a positive integer "fail" will be sent and I will be alerted.
3. Tracks database response time. Pingdom will log and graph the response time of that query.
This code example is for ColdFusion but would be the same in any language ( if it's so easy to get the execution time of a query that is )
Also there is an iPhone/Android app I use this more then the website in fact.
The report for response time looks like this:
Uptime like this:
Downtime like this:
Here is the code:
Pingdom effectivly polls a URL on your server for an expected outcome and alters you if that outcome if different from expected. This simple piece of code does 3 things for me:
1. Alerts me to the server being up of down. If Pingdom cannot contact the server I receive an SMS notification.
2. Alert me if the database is not responding. If the query fails Pingdom is expecting a positive integer "fail" will be sent and I will be alerted.
3. Tracks database response time. Pingdom will log and graph the response time of that query.
This code example is for ColdFusion but would be the same in any language ( if it's so easy to get the execution time of a query that is )
Also there is an iPhone/Android app I use this more then the website in fact.
The report for response time looks like this:
Uptime like this:
Downtime like this:
Here is the code:
Apr 25, 2012
I can't stand Apples iPhone earphones
I really can't. I'm not music connoisseur by any means but I can tell that the standard Apple earphones are not very good, yes I use them for hands free use and there OK for that but the music quality isn't was gets me its that they allow so much sound to escape. I travel 5 our of 7 days on public transport and there are so many people that keep the stanard earphones and I have to suffer and listen to what they are aswell. Apple please provide better ear phones for the next generation iPhone!
Feb 24, 2012
Railo 3 Beginner’s Guide book giveaway
Want to get a head start in Railo and CFML development? Packt Publishing is giving away 3 copies of Railo 3 Beginner’s Guide. I have this book and it's a great resource from installing Railo to developing web applications. The draw will be in 2 weeks and the winner will be notified by email simply fill in your details!
Feb 17, 2012
ColdFusion 10 in public Beta
Well ColdFusion 10 has been made into public Beta. This is great news. There are quite a few changes and one of the most significant to me ( I hope ) will be the easy path to patch my servers. I currently look after a large number of server behind a very active load balancer and it's quite costly in terms on time to upgrade each server. There are multiple other good introductions with ColdFusion 10 but that's my favourite at the moment.
Some others include:
And: http://nowshowingcoldfusionzeus.appspot.com/
Download it here: http://labs.adobe.com/technologies/coldfusion10/
Also ColdFusion Builder 2.01 is also in Beta so grab that aswell.
Some others include:
- Unique HTML5 built-in support to deliver richer interfaces without prior knowledge of HTML5
- Improved web services support using revamped engine and built-in support for REST
- Security enhancements to protect applications with new secure profile, improved authentication and encryption.
- Scheduler improvements to manage application-specific tasks, event handling, grouping, and chaining of tasks
- Built-in Tomcat server replacing Adobe JRun leading to performance improvements
- Instant notification and One-click Hotfix installer for updates
- Object Relational Mapping to build database independent applications without writing SQL
- Bi-directional Java integradfgtion to dynamically load libraries and invoke ColdFusion components (CFCs) from Java
And: http://nowshowingcoldfusionzeus.appspot.com/
Download it here: http://labs.adobe.com/technologies/coldfusion10/
Also ColdFusion Builder 2.01 is also in Beta so grab that aswell.
Feb 15, 2012
Where do you host your ColdFusion sites?
Lots of people ask me where I host my ColdFusion sites or recommendations for quality hosting. At work we use a large ( but expensive provider ) which is mostly out of individuals budgets. For my side projects I have switched to Amazon EC2 as my primary VPS solution. In fact the Windows and Linux micro instances are now free fro a year and you can run mySQL and ColdFusion on one of these servers. If you really want it to be free run Railo ( it's also got less over head ). I'd also recommend Rackspace as there cloud offering is really fast and they have great support. I'm also a fan of a bargain and have quite a few smaller VPS's that I pickup on sale from LowEndBox.com there often worth a try to get your Linux skills updated. As for shared hosting I don't have any preference but I do have an account at HostingAToZ which is very cheap ( $12.50 a year ) and hosts quite a few of the demos on this blog. Any one any have suggestions?
We used to have quite a few servers in Co-location but we have stopped that as really who wants to also manage and support hardware.
We used to have quite a few servers in Co-location but we have stopped that as really who wants to also manage and support hardware.
Jan 30, 2012
Client Varibles error in logs with registry - ColdFusion
Recently I have been spending some time diagnosing a CPU spike issue on one of our heavy load servers. The server runs lot's of small sites with a mixed code base some differnt developers over the years. Some of the code dates ~10 years.
The server is ColdFusion 9 64bit on Windows server 2008r2. While searching in the logs for any information I came across entries such as:
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245866-79360187\hitcount: Windows error number 0 occurred.The handle is invalid.
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245866-79360187\cftoken: Windows error number 0 occurred.The handle is invalid.
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245866-79360187\cfid: Windows error number 0 occurred.The handle is invalid.
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245871-49060600\urltoken: Windows error number 0 occurred.The handle is invalid.
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245871-49060600\lastvisit: Windows error number 0 occurred.The handle is invalid.
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245871-49060600\timecreated: Windows error number 0 occurred.The handle is invalid.
I immediately thought this was due to client variables which Mark Mandel confirmed via skype. I checked in CFADMIN ( "Server Settings > Client Variables" ) and confirmed that "Select Default Storage Mechanism for Client Sessions" was set to none. I thought this was enough to stop all use of client vars. It's not.
I ran a file search over the entire code base for:
cfset this.clientManagement or cfset application.clientManagement or clientManagement
I found one Application.cfc had:
I knew that application was not using client vars so I set this to false and the errors went away.
The log file to look for is: coldfusion-out.log on a default install ( single instance ) at [drive]:\ColdFusion9\runtime\logs
The server is ColdFusion 9 64bit on Windows server 2008r2. While searching in the logs for any information I came across entries such as:
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245866-79360187\hitcount: Windows error number 0 occurred.The handle is invalid.
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245866-79360187\cftoken: Windows error number 0 occurred.The handle is invalid.
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245866-79360187\cfid: Windows error number 0 occurred.The handle is invalid.
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245871-49060600\urltoken: Windows error number 0 occurred.The handle is invalid.
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245871-49060600\lastvisit: Windows error number 0 occurred.The handle is invalid.
01/30 14:26:04 Information [jrpp-32] - Unable to set value HKEY_LOCAL_MACHINE\SOFTWARE\Macromedia\ColdFusion\CurrentVersion\Clients\8245871-49060600\timecreated: Windows error number 0 occurred.The handle is invalid.
I immediately thought this was due to client variables which Mark Mandel confirmed via skype. I checked in CFADMIN ( "Server Settings > Client Variables" ) and confirmed that "Select Default Storage Mechanism for Client Sessions" was set to none. I thought this was enough to stop all use of client vars. It's not.
I ran a file search over the entire code base for:
cfset this.clientManagement or cfset application.clientManagement or clientManagement
I found one Application.cfc had:
Jan 12, 2012
Railo 3 Beginners Guide
I've recently been reading through Railo 3 Beginners Guide. While I have been working with CFML and Railo for a long time it's often still worth going back to basics and revisiting from the bottom up. Railo has come along way I was using Railo year back where I had to manually compile the connectors between Resin and apache I even remeber having to compile them and send then to a few people. It was alot of fun and the result was worth it. 1 it ran a few sites ( one which generated alot of traffic for several consistent months ) and 2 gave me the opportunity to delve deeper into my application server.
This book now walks you through installing Railo ( which is now very easy ) and getting started on working with cfml. I have just put on a new developer who has never seen cfml and is already able to work solo I thin it's a great strength of the language and a decent programmer/developers should in my opinion be language agnostic but when just getting started books such as this are a great place to start. One quick example is the a nice hidden tag that is amazingly easy to use. Showing someone new to Railo that tag alone will impress.
Anyway if ( like ) you are expanding your dev team and are considering hiring devs new to cfml ( and I recommend this ) I'd consider a copy of this book for your collection.
http://www.packtpub.com/railo-3-beginners-guide-to-develop-deploy-complex-applications-online/book
Jan 4, 2012
onError cfmail errors to yourself in ColdFusion in cfscript
I'm sure lots of people do the same thing as I do. In onError I eMail myself the errors ( and some other scopes ) so when errors occur on my application I can address them. Moving to script means I can have my entire Application.cfc in script how ever this introduced a small issue. Basically what I do is into the body of an email. With script it's a little more involved but still works eg:
You'll notice that I added output = true to the method annotation. I don't think that should be needed infact it works as expected in Railo. It's strange and not consistent with the tag implementation. I think its a bug in ACF. Before adding the annotation I was receiving my emails as expected but the body was always empty.
Update
Upon further investigation the code quoted above does not actually work. I think the actually issue is in mail.addPart();
However this code works just fine:
Dec 17, 2011
OpenBD on Google appengine - ColdFusion / CFML
I've been tidying up my blog and fixing some of the lost code samples and was moving around some of my code that was on Google App Engine. After workings out how to use OpenBD desktop to deploy new OpenBD CFML apps to GAE I realized I broke my demos. After a bit of searching I found this post.
http://groups.google.com/group/openbd/browse_thread/thread/e94b47a51e5d8a86?pli=1
And this is the Bug: http://code.google.com/p/googleappengine/issues/detail?id=5898
If your interested in OpenBD on GAE then vote for it.
Dec 14, 2011
Recover a datasource password in ColdFusion
I forgot a password to a mySQL datasource on my personal VPS. Not the end of the world I can log in to mySQL and reset it if I need but I knew these passwords were in new-datasource.xml in an encrypted format and was curious to see if I could decrypt that password. Turns out you can.
I used this post as a staring point http://paulalkema.com/post.cfm/pull-a-list-of-all-coldfusion-datasources-along-with-username-and-passwords
and while I was at it built this small app in case I need it in the future.
App: http://demo.kukiel.net/jquery/pass/
Dec 4, 2011
Rail ORM tomcat hibernate jvm settings permspace error
I've just started working on a small project using ORM and Railo. I'm running Ubuntu linux and the tomcat 7 installers with not chnage to jvm settings.
The first HQL query I ran a recieved an permSpace memory error. Not a huge deal but if your not used to the locations of the jvm settings it can be a bit of a challenge. PermSize was set to 64mb on the standard install which was a little to low.
The locations of the files for a standard install are:
/opt/railo/tomcat/bin
in: setenv.sh
I changed my settings to look like this:
-Xms128m -Xmx512m -XX:+CMSIncrementalMode -XX:+ExplicitGCInvokesConcurrent -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384m -XX:PermSize=384m -XX:+UseConcMarkSweepGC
Part of this was from Kai's example's which can be found here: http://t.co/aShOtpM
I have less RAM to work with so my settings are smaller.
my setenv.sh file looks like:
Railo can then re restarted by:
/etc/init.d/railo_ctl restart
My application continued to run as expected.
The first HQL query I ran a recieved an permSpace memory error. Not a huge deal but if your not used to the locations of the jvm settings it can be a bit of a challenge. PermSize was set to 64mb on the standard install which was a little to low.
The locations of the files for a standard install are:
/opt/railo/tomcat/bin
in: setenv.sh
I changed my settings to look like this:
-Xms128m -Xmx512m -XX:+CMSIncrementalMode -XX:+ExplicitGCInvokesConcurrent -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384m -XX:PermSize=384m -XX:+UseConcMarkSweepGC
Part of this was from Kai's example's which can be found here: http://t.co/aShOtpM
I have less RAM to work with so my settings are smaller.
my setenv.sh file looks like:
/etc/init.d/railo_ctl restart
My application continued to run as expected.
Subscribe to:
Posts (Atom)







