i’m having a problem after creating a new model and handler. it seems ORM just locks up completely or takes 5+ minutes to return when calling get(). ive tried replacing the virtualservice with just an EntityLoad(“CampaignAd”,rc.ad_id) and get same behavior. i have a feeling it’s an ORM issue…but not sure where to look. ormlogging it turned on but I don’t see anything in coldfusion-out.log?
what’s even wierder is that i have another model written for another table and that one works just fine…
any ideas how to figure out what’s wrong? I’m guessing something configuration since it works for everyone else…but don’t know where to even start looking.
If you have 100 different columns(!) in your CampaignAd model and table, as stated below, you’re going to have issues with loading recordsets from that model in to memory - especially if you have relationship properties to other models.
Adjusting the following two ORM settings to what’s shown below will help a bit, but you might want to re-think your table storage and its relationships.
100+ wide table seems like a concern to me. You can see the generated SQL if you view the console. My guess is that you have unexpected/undesired querying taking place.
with cf debug, it’s spending 96seconds in VirtualEntityService.cfc which is crazy.
i’ve also reduced the model to just 5 fields to try it out, did a ormReload() still same thing.
the model+table that works fine only has 5 fields in the model but about 70 fields in the table. i don’t see the huge difference from 1second to 96seconds
Execution Time
Total TimeAvg TimeCountTemplate
97049 ms 97049 ms 1 CFC[ /home/tcprod/yruan/projects/5.1.3_Winter_Games_coldbox/dmp/Application.cfc | onRequestStart(/dmp/index_cb.cfm) ] from /home/tcprod/yruan/projects/5.1.3_Winter_Games_coldbox/dmp/Application.cfc
96667 ms 96667 ms 1 CFC[ /home/tcprod/yruan/projects/5.1.3_Winter_Games_coldbox/coldbox/system/web/Controller.cfc | runEvent(defaultEvent = true) ] from /home/tcprod/yruan/projects/5.1.3_Winter_Games_coldbox/coldbox/system/web/Controller.cfc
96428 ms 96428 ms 1 CFC[ /home/tcprod/yruan/projects/5.1.3_Winter_Games_coldbox/dmp/HANDLERS/InsertionService.cfc | _privateInvoker(argCollection = [complex value], method = get) ] from /home/tcprod/yruan/projects/5.1.3_Winter_Games_coldbox/dmp/HANDLERS/InsertionService.cfc
96371 ms 96371 ms 1 CFC[ /home/tcprod/yruan/projects/5.1.3_Winter_Games_coldbox/coldbox/modules/cborm/models/VirtualEntityService.cfc | get(3803679) ] from /home/tcprod/yruan/projects/5.1.3_Winter_Games_coldbox/coldbox/modules/cborm/models/VirtualEntityService.cfc
Uh oh on the legacy database design. I’ve been there. The best suggestion I can give you, for the benefit of your app, is to refactor your schema for that table out to a better relational model. That may not be an option, though.
The other option is to set those properties that are non-essential on every load of that model as persistent=false and use a separate helper function to load them separately from a query when you need them. (e.g. - this.getExtraFields() )
The reason your 5 property/ 70 columns model works so fast is because hibernate doesn’t have to deal with those columns in HQL generation or and VirtualEntityService doesn’t have to deal with them either in property mapping and scoping, they are loaded with the query because they just exist in the table.
If you’re mainly working with query objects, then removing the non-essential columns as ORM properties will speed things up.
The number of properties is important, but the type of properties is arguably more important. You said that you experienced the same slowness by using entityLoad() directly, and I suggest you troubleshoot this without VirtualEntityService in the mix at all. As I said, look at the generated SQL. You might find a fetching strategy on one or more relationships is causing unnecessary querying.
is the actual SQL statement taking the time, or the CF processing after the SQL? If it’s the SQL, try it out in SSMS and analyze the query plan. If it’s the CF processing after, pull stack traces.
Also, did you disable the report execution times setting in debugging.
how would i find that? for sure if i run the sql statement in either oracle sql developer or even in a cfquery, it runs super fast. how would i do a stack trace?
ColdFusion Enterprise will pull a stack trace from the server monitor.
Tools such as Fusion Reactor or SeeFusion will also pull them for you
You can do it from the CommandLine with the Java process.
I recommend Fusion Reactor. 30-day trial. Look at several thread traces while it’s executing to get an idea of what parts of the code are getting the most amount of time spent on them.
Did you turn off the page execution time in your debugging?
An extra sentence just in case you don’t aren’t reading the last sentence in my E-mails.
stacktrace. it doesn’t seem like provides much info. yea i’m doing the EntityLoad for 90+ seconds and then everything returns. it feels like waiting for a timeout. i’ll try fusionreactor and see if that provides me with more detail
Sorry, that’s not a full stack trace, just a tag stack. The difference is a tag stack only shows you the sequence of CF files processed, whereas a full stack traces shows you all the way down to the Java code running behind the scenes.
if i remove ormtype=“double”, it speeds up. but i’m reading docs and that’ll default to string. so that’s not what we want. i chose ormtype=“integer” instead and it stills seems to be fast! i hope that’s it…