Tweak:5

0 views
Skip to first unread message

Sana

unread,
Sep 24, 2008, 1:37:16 AM9/24/08
to Skweegee Development
Russ,

Main.cfc ---> onRequestStart()

<cfset rc.Transfer =
getColdboxOCM().get("TransferFactory").getTransfer()>
<cfset
rc.transfer.addBeforeCreateObserver(createObject('component','skweegee.model.TransferEvents'))>
<cfset
rc.transfer.addBeforeUpdateObserver(createObject('component','skweegee.model.TransferEvents'))>

Not sure why creating these objects on each request. I think this
could be placed in onAppInit() to avoid additional processing at each
request.

Thanks

Russ Johnson

unread,
Sep 24, 2008, 1:51:40 AM9/24/08
to skweeg...@googlegroups.com
Sana,

Im not positive but I think these have to be called on each request
since you are putting the transfer object into the rc scope.

Its pulling the transfer object from the coldbox cache so it shouldnt
be creating any performance hits.

Now the observer calls could probably be moved into the onAppInit
method now that Im thinking about it. But Im pretty sure that the
first call has to be in the request start.

- Russ

Russ Johnson

unread,
Sep 24, 2008, 1:57:25 AM9/24/08
to skweeg...@googlegroups.com
Since Im up late working on it anyway, I went ahead and moved the
Observer calles into the onAppInit() method and it seems to work fine.

I will commit this to SVN shortly.

Thanks for the catch...

On Sep 24, 2008, at 1:37 AM, Sana wrote:

Reply all
Reply to author
Forward
0 new messages