-->
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.  [ 2 posts ] 
Author Message
 Post subject: terminate running SQL statement
PostPosted: Thu Oct 26, 2006 2:53 pm 
Newbie

Joined: Wed Mar 15, 2006 10:56 am
Posts: 8
Location: Ohio USA
Hi all,

I have an application which has a jsp front end and ejb as middle tier (SLSB) and Mule as ESB and hibernate as the ORM layer.
Now when the user starts to do a search, we give him a popup saying that the search has started.
There is a cancel button in this window.
If the use cancels his operation is there a way for me to cancel the query which is running in the DB and inform hibernate about this so that I can inform the user also.

Here are my parameters to my hibernate file
<property name="hibernate.jndi.class">weblogic.jndi.WLInitialContextFactory</property>
<property name="connection.datasource">jdbc/epcGmnaDataSource</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">javax.transaction.UserTransaction</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="current_session_context_class">jta</property>
<property name="show_sql">false</property>
<property name="hibernate.cglib.use_reflection_optimizer">false</property>
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.cache.use_minimal_gets">true</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="hibernate.cache.provider_configuration_file_resource_path">/ehcache.xml</property>
<property name="hibernate.cache.use_second_level_cache">true</property>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 26, 2006 11:51 pm 
Regular
Regular

Joined: Tue Sep 26, 2006 11:37 am
Posts: 115
Location: Sacramento, CA
There are lots of applications that implement cancel by letting the UI continue while letting the backend proceed to a safe stopping point. There are ways to kill a connection, for example for mysql the following
http://dev.mysql.com/doc/refman/5.0/en/kill.html

I do not think it is a good idea to use this as a regular way to stop connections. Maybe you can design your application to:
1. use faster queries
2. use pagination or limit on the number of returned rows to complete faster
3. run the queries in a different thread, asynchronously and query from the browser in successive request

I hope this helps :)

Marius


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.