Viewers: in countries Watching now:
In ColdFusion 9 New Features, author and developer Dan Short has gathered together the important updates and improvements in this dynamic web application. Dan showcases the new ColdFusion Builder application throughout the course, using it to work through the new language and CFScript enhancements in this release. He shows how to use the new Server Manager to compare servers and create server groups, as well as monitor server health through notifications. He also explains the new integration with Office applications, building Excel, Word, and even PowerPoint files on the fly from ColdFusion. Finally, he covers the important new Object Relational Mapping feature and how to use the built-in Flash Player. Exercise files accompany this course.
If you're anything like me, using ORM the first time around is pretty scary. I have been writing my own SQL statements for well over a decade and it goes against my controlling nature to turn all of that oh-so important work, over to the ORM black box inside ColdFusion 9. Luckily, Adobe has provided a way to let us take a peek under the covers to see exactly what SQL is getting run when we execute any ORM actions. In this video, I am going to show you how to turn on ColdFusion 9's ORM SQL logging and keep an eye on what's going on in your application.
So to turn on the SQL logging, Application.cfc file inside Chapter5, we are just going to add one attribute to the ORM settings that we have set up in the previous video. So, I am going to add logsql = "true" and that's all it takes to start taking a look at what's going on inside of the ORM functionality in ColdFusion. So, let's open up hibernate.cfm and we have the same EntityLoad statement that we also used in a previous video. If I go ahead and show the console inside CF Builder, I will be able to take a look at what's going on inside my SQL statements.
But I need to make sure that if I've just turned on SQL logging, that I reload the ORM configuration. So, let's go ahead and add that up to the top here. I will do cfset ORMReload. So, we can make sure that the ORM configuration gets reloaded and SQL logging gets turned on. So, I will save my file and preview it and in the Console here, let's go ahead and make this larger. We can see that it's using log4j, an open -source Java logging application to log all of our hibernated SQL.
So, we can see exactly what it has run on our SQL Server. Now because ColdFusion 9 uses log4j, if you know how to edit the log4j properties, you could log your SQL information on to a flat file, send it via e-mail or SMS or use any other type of logging output that log4j supports. Hopefully, you can now feel a little better about using ColdFusion 9's ORM functionality. Just remember not to leave the SQL logging enabled in a production environment, as it could have a negative impact on the performance of your application, as all of this logging happens in the background.
There are currently no FAQs about ColdFusion 9 New Features.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.