I just upgraded from M5 to M6. Portions of my service layer extend the
new VirtualEntityService (hence BaseORMService) to be able to play
with ORM entities nicely, hence I hit the issues quickly that I
detailed in my the earlier post on ORM Helper changes.
My service layer architecture worked like a charm in M5 but one of the
ORM helper changes I just mentioned for M6 appears to spin my app out
of control. In M6, BaseORMService is now tying ORM event interception
to coldbox.system.orm.hibernate.EventHandler, and is enabling this
interception by default.
Now upon any Hibernate usage, I see Tracer messages for
announceInterception on preLoad and postLoad on any entity loaded. It
is dumping the arguments for those interceptions so is attempting to
utilize Hibernate entities well after I use them in my codebase. Any
lazy relationships generate a slew of Hibernate errors that "Session
is closed" (as it should) as it attempts to dump the dumped
output.
A simple user get screen just became 40megs to download with this
fully tracer dump mode on in Debug mode with the way I'm eager loading
data. Yikes! Needless to say my list screens listing 10-50 objects
just killed Coldfusion altogether (went into la la land, required
restart).
I turned off tracer panel to immediately fix my app from hanging,
however Tracer is essential in my situation as I use it for debugging
purposes during development. FOR NOW my immediate fix is edit core
codebase to turn off the default event handler in BaseORMService.cfc
by setting the default property = false and the init() param = false
as well. This has worked around the issue for now. (That way I don't
have to go to each CFC in my service layer to add the new init() param
to set it to false.)
1) I haven't much used announced interception so am unsure how to turn
off having those interceptions dump to Tracer panel. Is there a way
to prevent AnnounceInterception from doing this without disabling
Tracer panel altogether? It's nice to know about the custom intercept
points getting triggered but not nice to dump every single entity
repeatedly.
2) I'm not sure having event handling on by default in M6 was the
proper choice. I was already using event handler via the method set
up in M5 (via ormsettings.eventHandler calling the earlier provided
ORMEventHandler.cfc). This new technique seems to completely override
that earlier handler. Having this as default behavior really threw a
wrench into my existing application given their default behavior of
CFDUMPing each object to screen twice minimally (pre & post
events).
Luis - What is the best way to get not have these ORM events dumping
to Tracer panel w/o changing core Coldbox? I will eventually be tying
into these interception points so want them -- but absolutely cannot
be dumping the entire entity on each interception in Tracer!
Thanks,
-m