Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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: 17346
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
 
You showed up just in time for the waffles! And this tiny ad:
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
reply
    Bookmark Topic Watch Topic
  • New Topic