This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

EJB QL complexity and query time

 
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.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE 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
 
He does not suffer fools gladly. But this tiny ad does:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic