db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Holtzman <j...@joshholtzman.com>
Subject Performance problems
Date Thu, 27 Nov 2003 06:38:57 GMT
I'm using torque in a webapp, and I'm seeing really slow performance 
when I try to get data from "nested" objects.  Here's what I mean:

I have a torque object named Account.  An account can have several 
Assignments, which is another torque object.  An assignment can have 
Jobs (yup -- another torque object) and a Job can have a Category (yet 
another torque object).  Due to the amount of data stored in each of 
these, they must be separate objects (I'm trying to avoid eliciting the 
obvious solution "put all of that info in one object" suggestion).

I grab a list of accounts in my servlet with a doSelect(criteria) and 
send them to a JSP to be displayed (I'm using struts, but that's beside 
the point).  If I ask the JSP to just display info in the Account 
object, everything runs quickly.  If I ask the JSP to get the Account's 
Assignments and display info from the Assignments, it slows down a bit.  
Once I ask for Job or category info, it grinds to a crawl.

I'm wondering what's going on when I ask the JSP to 
account.getAssignments().  Is the JSP hitting the database in order to 
instantiate the account's assignments?  I would think that when I 
instantiated the Account, all of its own internal objects (the 
assignments, the jobs, the categories) would also be instantiated.  So 
why then the huge performance hit?

I know that I am missing something here, so please, all of you Torque 
gurus, let me know where young grasshopper has strayed from the path.  
And if I need to provide more details (code, etc), I can do that too.

Thanks so much,
Josh


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message