FusionReactor's JDBC Driver Wrapper is a great addition to ColdFusion 9's Object-Relational Modeling capabilities. You can use it to spy on what Hibernate (ColdFusion's ORM provider) is really doing to your database.
This article doesn't go into detail about what ORM is, or how it works – there are many posts and articles on the web which cover this in detail:
Adobe's integration of the third-party Hibernate framework brings ORM functionality to your CFC-based applications. This brings with it some new, important concerns for ColdFusion developers:
You can use the setting Application.cfc setting this.ormsettings.logSQL to have Hibernate dump its SQL to the log as it's created, but you'll soon find the log is overflowing with data.
Getting this working is simple, just follow the steps below.
.. for example.
Once you've installed the FusionReactor JDBC Driver Wrapper, and adjusted your Application.cfc to point to the wrapped datasource, you can have a look at the collected data. We ran the 01_createmusician.cfm script from Mark Mandel's introductory app (from Introducing ORM in Adobe ColdFusion 9), with this.ormsettings.logSQL = true turned on in our Application.cfc.
What came out in the log was:
But that's not only what ran – the log isn't showing you everything. Inspecting the JDBC tab of the request in FusionReactor actually shows us exactly what's going on:
There's actually a whole bunch of overhead. We turned on "Record In Order" in FusionReactor's JDBC Settings, so this list is in time order – including a whole set of alters, drops, creates (JDBC transaction 1), then the load of sample data (transactions 2 and 3), the actual insert from the CFM page itself (transactions 4 and 5), and the select from the page for the dump (transaction 6).
We think FusionReactor's JDBC Driver Wrapper is an awesome tool to spy on exactly how Hibernate and ColdFusion 9 is interacting with your database. Object-Relational Modeling is going to revolutionize how you deal with your databases, and FusionReactor is going to make your life easier in analyzing and solving problems.
|Last Updated:||08/Sep/11 10:50 AM|
|Fixed Version:||3.5, 4.0.0|
Comments are closed.