-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: How does one cancel a query?
PostPosted: Thu Oct 30, 2003 7:20 pm 
Newbie

Joined: Thu Oct 30, 2003 7:15 pm
Posts: 2
Location: San Antonio, TX
Sirs/Madams,

What's the proper way to allow a user to cancel a long-running query initiated by Query.list()? I tried Session.close() from a separate thread, but it complains quite loudly. According to the docs, the session implementation is not likely to be thread-safe. Sooo... how can i have one thread running a query and another thread come along and cancel the query?

Thanks,
Jeff


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2003 7:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Hmmmm this is very interesting. No-one ever asked for this before. I never thought about it, 'cos its not something you can do in a web application.

So we need a Query.cancel() method? Hummm ... oh kah ....

Add it to JIRA.

For now, use Query.setTimeout()


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2003 8:19 pm 
Newbie

Joined: Thu Oct 30, 2003 7:15 pm
Posts: 2
Location: San Antonio, TX
Done. Thanks, gavin.

BTW, i think we're doing a *lot* of things not anticipated... and it's holding up really well. The biggest difficulty is in getting my DBAs to be happy about us (the java team) using Hibernate. They lose sleep when apps don't access the data through stored procedures, and can't stand the idea that their precious database is treated like a "storage tank" ;]

Anyway, thanks again.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2003 8:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I have implemented this as Session.cancelQuery(). Probably commit it later today. Useful, I think.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2003 3:34 am 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
ludditeGeek wrote:
They lose sleep when apps don't access the data through stored procedures, and can't stand the idea that their precious database is treated like a "storage tank" ;]


By default, any person is loosing sleep when another person is doing something that makes said person less important/critical ;-) It get's annoying when stupid architechture decisions have to be made because of such people :-|


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2003 3:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Strangely enough, we are not out to make data people redundant here. In fact, doing Hibernate has given me a much better appreciation for what DBAs and data modellers actually do. What we are really trying to do is let them get back to doing what they do well, instead of what we do well (ie. write code).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.