• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB QL complexity and query time

 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a generated EJB 3.0 QL query string, that is timing out.
At 5 minutes JBoss aborted the call with the following :



This is the query that ultimately did me in. I think when the last line is a 'he%' it finishes quickly.

Is there a better way to phrase the EJB QL? (I'm definitely not a under-the-covers SQL expert)

Am I just lucky the over-normalized design didn't splat earlier? (Simpler queries, and fetching has been super fast.)

Is there some way to ask the EJB framework to abort earlier or more cleanly?

Any other advice welcome.

Note: addressUsages is an implementation artifact of a named N-to-M relationship.


The object model is highly normalized. The queries up to this point have been ok.
entity code snippits:



Addendum: this also caused a mysqld CPU runaway in JBoss 4.2.2

Edit: added 3.0 clarification
[ August 27, 2008: Message edited by: Bill Shirley ]
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found a better phrased EJB QL that serves my purposes.
It returns MUCH more quickly, and doesn't cause the several other problems the original was causing.



Now I need to modify the EJB QL generating code ...

... off to the fun.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB QL or is this EJB3?

Which would be JPA-QL, since in EJB3 there are no more Entity Beans, but they split out JPA which can be used instead of the old EJB Entity Beans.

Mark
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, to clarify, the EJB 3.0 version

the JPA is, of course, a subset of EJB 3.0; I've never heard the query language referred to JPA-QL, but the 3.0/JPA version was updated from the original EJB QL; the updated one is the one i'm talking about,

There are still Entity beans in EJB 3.0
they are different than in 2.1
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic