anyway to initialize ORM AFTER onApplicationStart()?

0 views
Skip to first unread message

hofar...@houseoffusion.com

unread,
Mar 18, 2015, 7:22:22 PM3/18/15
to ColdFusion Technical Talk

current app sets the datasource in onApplicationStart(). i can't have ormEnabled=true unless there's a datasource. and it doesn't look like i can intialize orm at the end of onApplicationStart() by doing a this.ormEnabled=true

what are the alternatives?

I'm thinking one where i set this.datasource at the top of Application.cfc using a method getDatasource() and pull all of the datasource configuration code that's currently in onApplicationStart() and putting it into that new method. but that's quite a bit of work and leads to lots of change and lots of testing. anything ideas for less changing?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360265

hofar...@houseoffusion.com

unread,
Mar 19, 2015, 6:33:07 AM3/19/15
to ColdFusion Technical Talk

On Thu, Mar 19, 2015 at 12:22 AM, Yuliang Ruan wrote:
>
> current app sets the datasource in onApplicationStart(). i can't have
> ormEnabled=true unless there's a datasource. and it doesn't look like i
> can intialize orm at the end of onApplicationStart() by doing a
> this.ormEnabled=true
>
> what are the alternatives?
>

When we ran into this we moved datasource initialization from
onApplicationStart() to onServerStart().

Jochem


--
Jochem van Dieten
http://jochem.vandieten.net/


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360268
Reply all
Reply to author
Forward
0 new messages