[coldbox-4.2.0] ormReload not updating model

Hi,

I have the following in Application.cfc in the onRequestStart function so I can reload the ORM whenever I make changes to the models:

if( structKeyExists(URL,“ORMReload”) ){
ORMReload();
}

Whenever I need to reload ORM, I would append the following:
?ormReload

This used to work in ColdBox 3.8, however after upgrading to ColdBox 4.2.0, it hasn’t worked, unless I change the following in Application.cfc:

this.sessionTimeout = createTimeSpan(0,0,0,0);
this.applicationTimeout = createTimeSpan(0,0,0,0);

Refresh the application framework, i.e. ?fwreinit=1. Then reset the session and application timeout back to 30 minutes, say.
What has changed from coldbox 3.8 to 4.2? What am i doing wrong?

Please note in this.ormSettings struct I have the following (partial snippet):
dbcreate = “update”,
eventhandling = true,
flushAtRequestEnd = false

Hi Yieng,

ORMReload() is CF function and its nothing to do with ColdBox, Make sure that file caching " " is disabled in cf admin-console.

This used to work in ColdBox 3.8, however after upgrading to ColdBox 4.2.0, it hasn’t worked

Can you unpack this for us? What doesn’t work? Is there an error? Does your app not behave as expected? Are code changes not picked up? If so, what kind of code changes? Perhaps some debugging code (dump/abort) will show you if the ORMReload() function is actually running. Also, what version of ColdFusion or Lucee are you using?

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I am using Adobe ColdFusion 11 and ColdBox 4.2.0. I have now found out that if:

  • I have not logged into the Coldbox application, then running the ormReload won’t create the new table in the databases if I added a new model.
  • I have logged into ColdBox application, then running the ormReload will create the new table in the database if I added a new model.

That’s quite an unexpected observation. Mostly because CF’s ORM engine has no concept of your application’s login. Is there any particular code in your application that only runs when you’re logged in that might make a difference? I don’t think it’s possible that the login is directly the reason for the behavior, but there must be something different about how the app behaves when you’re logged in that affects it.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com