If your entities all have relationships with lazy = false, the issue could
possibly be that you are trying to load too many objects and you simply
don’t have sufficient memory available.
That said, on a practical basis, I would not use ORM to load more than a
single instance of an entity, but simply get the data you need using sql.
My guess is that you are displaying a list of active companies, but by
using ORM for this, you are loading, it seems, at least 1100 objects in
memory including the linked Members, and Members may be linked to other
entities if lazy loading is set to false - which could graph out to a
significant chunk of the database with all the methods that are included in
an ORM object. I would ask why. Do you need the methods on all those object
available for what you are trying to accomplish? My guess would be that you
don’t.
As to why it worked before and it doesn’t work now, you may have more
memory in production, or it may be that under the covers, a newer version
of hibernate, or the code between hibernate and Railo / Lucee, is handling
this differently. Memory you can figure out, the stuff under the covers is
practically inaccessible in the sense that if it isn’t working, you can’t
do much about it. The fact that it is nicely abstracted away is a
double-edged sword.
Sql isn’t abstracted away, so you write “select id, name from Company where
active = 1 order by name” and use that instead, and your performance will
likely be significantly better, and reliably so, even with little memory
available, and no matter what happens with hibernate or the code
integrating it with Lucee.
Could be completely off base without direct access to your code and
requirements, so my apologies in advance if this is the case.
Aria Media Sagl
+41 (0)76 303 4477 cell
skype: ariamediaOn Sat, Sep 3, 2016 at 6:26 PM, Ivan McAvinchey <@Ivan_McAvinchey> wrote:
Lucee 4.5 on Windows 10.
I have a FW/1 application. I’ve narrowed this down to (for example) a
single simple entity load in the controller:
rc.companies = entityLoad(“Company”, {active = 1}, “name asc”);
This entity has around 100 records. There’s around 1000 in a linked
“Members” entity.
With this in the controller and nothing else, it takes 60-250 seconds,
even if it is the only thing in the controller and I output nothing in the
view.
It’s inconsistent, sometimes it will actually come back fast, sometimes 60
secs, sometimes 250, occasionally goes to 300 and times out. But usually
60-75. No obvious pattern.
Lucee in the debug information can’t see it is taking this long, it is
telling me the page is taking one second or less.
Tomcat when set to log page duration logs it correctly- 60-70 seconds. So
Lucee is missing, or not recording something here.
The entity does have children. If I set lazy=“true” on the relationships,
the load will come back reasonably fast- like 3-4 seconds. I DO think this
is still slow, and indicates something wrong, but it’s faster. But the
problem then comes back when I put the output back, it’s back to glacial.
It’s not specific to this one, though, I’ve seen the same behaviour with
another simple pair of entities which were just Countries (250 or so) and
States (80 or so). It seems to affect anything with 100+ records, it slows
to a crawl. Possibly only an issue if relationships are involved.
Now the bizarre stuff- the exact same code is running fine in production
on Railo 4.2 (on Linux) and comes back quickly (under a second).
If I take this line OUT of the FW/1 app in my Lucee 4.5 dev environment
and just run it by itself, it comes back quick, under a second. That’s with
all the output, it’s fast.
So it is some interaction of Lucee, FW/1, and whatever else we have in the
app.
Any ideas? It is driving me mad. Pointers to things to try/look at
appreciated.
–
Get 10% off of the regular price for this years CFCamp in Munich, Germany
(Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€
instead of 210€. Visit https://ti.to/cfcamp/cfcamp-
2016/discount/Lucee@cfcamp
You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/lucee/84049170-e72e-44f5-99ac-285727639fe4%40googlegroups.com
https://groups.google.com/d/msgid/lucee/84049170-e72e-44f5-99ac-285727639fe4%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.