Search

Tuesday, September 25, 2007

Reactor Oops - Case Sensitive Dictionary XML

Here is the message I got today while trying to do some work with reactor and model-glue.

Message An error occurred while Transforming an XML document.

Detail Empty expression!

Extended Info

Tag Context D:\_Webroot\reactor\core\objectTranslator.cfc (149) D:\_Webroot\reactor\core\objectTranslator.cfc (164) D:\_Webroot\reactor\core\objectTranslator.cfc (164) D:\_Webroot\reactor\core\objectTranslator.cfc (101) D:\_Webroot\reactor\core\objectFactory.cfc (223) D:\_Webroot\reactor\reactorFactory.cfc (80) D:\_Webroot\reactor\base\abstractRecord.cfc (393) D:\_Webroot\reactor\project\myproject\Validator\usersValidator.cfc (10)

It turned out that the dictionary file that reactor generated is case sensitive. I need to change "<Users>" to "<users>". The table is defined as "users" but I had to change it to "<Users>" on my home machine. It seems that reactor can't make up it's mind on how it wont's the table to be called. Why is it "Users" at home and "users" at work? I'm using Apache on Windows with the same version of MySQL and reactor on both machines.

Update: So I just learned that:

<cfset usersRecord = variables.reactor.createRecord("users") />
is not the same as:
<cfset usersRecord = variables.reactor.createRecord("Users") />
The dictionary file was created with "Users" as the table name so reactor was looking for the same case. I think this is only an issue with MySQL.
// //]]>