Skip to main content
Participating Frequently
February 3, 2011
Answered

ORM setup help?!

  • February 3, 2011
  • 3 replies
  • 2167 views

Hi there

I've followed the basic example to setup ORM on the CF9 sites but I always get an error: ORM is not configured for the current application.

What am I missing?

Here is my DB table (table is named ip_bw_list) structure;

[id] [int] IDENTITY(1,1) NOT NULL,

[ip_address] [nvarchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,

[email] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,

[status] [int] NOT NULL

This is my application.cfc code

<cfcomponent output="false">

<cfset this.datasource = "EDO-CRM"/>

<cfset this.ormEnabled = true />

<cffunction name="onRequestStart" returntype="boolean" output="true">

<!---data source --->

<cfset REQUEST.dsn = "edo-crm">

<!--- set application root folder. Get this directory --->

<cfset var thisDirectory = ExpandPath("./")>

<!--- Strip out this folder name --->

<cfset REQUEST.root_path = listLast(Left(thisDirectory,Len(thisDirectory)-1),"\/")>

<!--- Set the component root folder --->

<cfset REQUEST.mcom = REQUEST.root_path & ".components.">

    <cfset Request.PasswordKey = "w0qj5bh19ne437b52">

<cfreturn true>

</cffunction>

</cfcomponent>

This is my component ip_bw_list.cfc

<cfcomponent persistent="true">

<cfproperty name="id" generator="increment">

<cfproperty name="ip_address">

<cfproperty name="email" >

<cfproperty name="status">

</cfcomponent>

This is my attempt to use it (where I'm getting my failure)

<cfset blacklist = EntityLoad("ip_bw_list")> 

<cfdump var = "#blacklist#"/> 

By the way my datasource is definitely correct and I'm using DW 8.

Really excited about using this feature but really frustrated by the fact I'm failing at the first hurdle.

Thanks for your help.

Ian.

This topic has been closed for replies.
Correct answer mack_

I only have one applicaiton.cfc which is being used and working as expected in index.cfm BEFORE I have the fusebox code. Using the exact same code after the fusebox code it fails.

This is my index.cfm file code;

<!--- ORM call will work here BEFORE Fusebox code --->

<cfset blacklist = EntityLoad("ip_bw_list")> 

<cfdump var = "#blacklist#"/> 

<!--- This part of the site is currently under construction --->

<!--- include the core FuseBox --->

<cflock type="READONLY" name="#server.coldfusion.productVersion#" timeout="10">

<cfset variables.fuseboxVersion=Replace(Replace(ListDeleteAt(server.coldfusion.productVersion,4),",","","all")," ","","all")>

<cfset variables.fuseboxOSName=server.os.name>

</cflock>

<cfif variables.fuseboxVersion lte 450>

<cfinclude template="fbx_fusebox30_CF40.cfm">

<cfelseif variables.fuseboxVersion lt 500>

<cfif variables.fuseboxOSName contains "Windows">

<cfinclude template="fbx_fusebox30_CF45.cfm">

<cfelse>

<cfinclude template="fbx_fusebox30_CF45_nix.cfm">

</cfif>

<cfelse>

<cfif variables.fuseboxOSName contains "Windows">

<cfinclude template="fbx_fusebox30_CF50.cfm">

<cfelse>

<cfinclude template="fbx_fusebox30_CF50_nix.cfm">

</cfif>

</cfif>

<!--- <cfinclude template="dsp_underConstruction.cfm"> --->

<!--- This file is not a part of the Fusebox Spec. It is provided merely as a courtesy. Remove all the code on this page except for the <cfinclude> line for the platform and CF version you are running. --->

<!--- This site is temporarily unavailable while maintenance takes place.<br>

We apologize for any inconvenience this may cause. --->

<!--- ORM call will NOT work here AFTER Fusebox code --->

<cfset blacklist = EntityLoad("ip_bw_list")> 

<cfdump var = "#blacklist#"/> 


Maybe fusebox changes the application by using a cfapplication tag ?

--

Mack

3 replies

Participating Frequently
February 4, 2011

Sorted!

Fusebox has a root fbx_settings.cfm file in which there is a line:

<cfapplication sessionmanagement="yes" sessiontimeout="#createTimeSpan(0,0,30,0)#" clientmanagement="yes" name="crm">

I removed this and put this into Application.cfc

<cfset this.SessionManagement = true/>

<cfset THIS.SessionTimeout = CreateTimeSpan( 0, 0, 30, 0) />

And that has fixed it! Thanks to all for your replies. Gotta love the community! Looking forward to using these new features now.

Participating Frequently
February 3, 2011

UPDATE:

I use the fusebox (3) framework and I just ran a test to by pass the framework and I got expected correct output?

So now the question is how do I use the ORM functionality in conjunction the fusebox?????

Ian.

Owainnorth
Inspiring
February 3, 2011

Pretty sure you need to have a <cfset this.name = "myApplicationName" /> in your Application.cfc before it'll work.

Give that a go

Participating Frequently
February 3, 2011

Nope

That was something I had in previously but it still failed.

I just tried again. I put <cfset this.name = "EDO-CRM" /> in my application.cfc (after <cfcomponent output="false">) and still no luck!

Ian.    

Participating Frequently
February 3, 2011

Make sure that you're loading the right Application.cfc file.

If this is part of a bigger application try to isolate a small test to

see if you still get the error.

--

Mack