From derby-user-return-9678-apmail-db-derby-user-archive=db.apache.org@db.apache.org Wed Aug 20 16:11:32 2008 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 7127 invoked from network); 20 Aug 2008 16:11:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Aug 2008 16:11:32 -0000 Received: (qmail 21699 invoked by uid 500); 20 Aug 2008 16:11:29 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 21672 invoked by uid 500); 20 Aug 2008 16:11:29 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 21661 invoked by uid 99); 20 Aug 2008 16:11:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2008 09:11:29 -0700 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.18.43.132] (HELO sca-es-mail-1.sun.com) (192.18.43.132) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2008 16:10:31 +0000 Received: from fe-sfbay-09.sun.com ([192.18.43.129]) by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m7KGB0GW011142 for ; Wed, 20 Aug 2008 09:11:00 -0700 (PDT) Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K5W00C01PI40P00@fe-sfbay-09.sun.com> (original mail from Richard.Hillegas@Sun.COM) for derby-user@db.apache.org; Wed, 20 Aug 2008 09:11:00 -0700 (PDT) Received: from richard-hillegas-computer.local ([129.150.17.173]) by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K5W00HD5QA7K4E0@fe-sfbay-09.sun.com> for derby-user@db.apache.org; Wed, 20 Aug 2008 09:10:55 -0700 (PDT) Date: Wed, 20 Aug 2008 09:10:54 -0700 From: Rick Hillegas Subject: Re: Kill user session In-reply-to: <19064917.post@talk.nabble.com> Sender: Richard.Hillegas@Sun.COM To: Derby Discussion Message-id: <48AC420E.1070205@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <158650.59252.qm@web36106.mail.mud.yahoo.com> <48AACCC0.2040909@sun.com> <19064917.post@talk.nabble.com> User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) X-Virus-Checked: Checked by ClamAV on apache.org Hi Jean-Marc, I don't know of any support in Derby for this. Maybe you could code the support outside Derby. For instance, if your clients got their sessions from a connection manager which you controlled, then you could cache open connections and kill them as needed. To kill a connection, I think that the following would work: conn.rollback(); conn.close(); If you are running Derby under an application server, it is possible that the application server may provide some support for what you need to do. Hope this helps, -Rick JM Malmedy wrote: > Hi Rick, > > First of all, thank you for your fast and useful answer. > > In fact my problem is that the database is used together by customer GUI > applications that execute small and well-controlled transactions but also by > some "power" users that execute their own SQL requests for reporting. Very > often these users run a SQL which is not optimized and that take a lot of > resources and, of course, that's very disturbing for the GUI applications. > That's why I'd like to be able to kill these SQL requests when needed > directly on the server. Is there any workaround to do this? > > Thanks again. > > Jean-Marc > > > Rick Hillegas-2 wrote: > >> Hi Jean-Marc, >> >> The following query will list the in-flight transactions and the users >> who are running them. For more information, please see the section >> titled "SYSCS_DIAG diagnostic tables and functions" in the Derby >> Reference Manual: http://db.apache.org/derby/docs/10.4/ref/ >> >> select * from SYSCS_DIAG.TRANSACTION_TABLE >> >> I'm not aware of any graceful way to terminate another user's session. >> >> Hope this helps, >> -Rick >> >> Jean-Marc MALMEDY wrote: >> >>> Hi, >>> I'd like to know whether there is a way to retrieve the list of the users >>> currently connected to Derby (network server environment) and their >>> running transactions. Is it possible to force the disconnection of a user >>> and to kill his running transactions without having to restart the >>> server? >>> Thank you in advance. >>> JM Malmedy >>> >>> >>> >>> >>> >>> >> >> > >