• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB QL complexity and query time

 
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic