Meaningless Drivel is fun!
The moose likes Object Relational Mapping and the fly likes utterly stumped - HQL query stalls program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "utterly stumped - HQL query stalls program" Watch "utterly stumped - HQL query stalls program" New topic

utterly stumped - HQL query stalls program

Stuart Rogers
Ranch Hand

Joined: Oct 02, 2008
Posts: 140
Greetings all,

I've used Eclipse to create a Spring/Hibernate standalone desktop GUI app whose behavior has got me buffaloed - it stalls with no error messages when it hits an HQL query statement in a DAO method.

and the relavent parts of my stripped-down app. All it does is accept two string values and has two Login buttons.
Each calls validateAgainstDB which in turn calls the the DAO's validateIt method.

executing opens the GUI just fine, I fill in the username and password, click the LoginA button , validateAgainstDB gets called, UserDAOHibernate.validateIt gets called,
"got to A" gets printed then the program stalls on line 46. No error msgs, nothing, like an infinite wait-state. Commenting out lines 46-62 and forcing
out_bool = true at the top of the method allows the program to work perfectly.

So I am at a loss - how could this be happening, and how do I debug something when there's no messages or errors thrown?


Still-learning Steve

Stuart Rogers
Ranch Hand

Joined: Oct 02, 2008
Posts: 140
I'm so frustrated with this that I'm willing to put some cold hard cash out to get it solved - if you live within 30mi of Arizona State University, we can meet someplace , I'll bring my laptop and if you can get this thing working it's worth USD50.00 .

Or if you're further away but still want a crack at it, I could zip up some scripts and send it to you. You'd have to create a User table and populate it with one row, the adjust a properties file to point to your database.


Still-stumped Steve
Komal Renu
Ranch Hand

Joined: Jul 21, 2011
Posts: 51
Hey Steve,

not sure why this absurd behavior. But i'd like to give it a try, send me the necessary files so that i can test it here locally.

Thanks and Regards,
Komal Renu | |
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

You could do the following to get some more information on cause
1.) Take thread dump when the application is stalled. It will tell you the exact piece of code/line causing the problem.
2.) Enable show sql in Hibernate, it will output the HQL along with the generted SQL. You could execute the SQL to check if the SQL is causing issues.

How much data is there in the user table ?
Stuart Rogers
Ranch Hand

Joined: Oct 02, 2008
Posts: 140
I can try grabbing a thread-dump. Stalling *seems* to occur when the Query is built. But it's a very simple HQL query, of a form I've used dozens of times before. I feel the stalling is transaction/thread related .

I will try turning on "show sql" and look at the *real* generated SQL statement - perhaps there's something hinky happening because this table is called User/users.

Thanks for your help!


Still-learning Steve
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 661

Can you post your configuration files?

If you are not laughing at yourself, then you just didn't get the joke.
I agree. Here's the link:
subject: utterly stumped - HQL query stalls program
It's not a secret anymore!