Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0001C6122 for ; Wed, 6 Jul 2011 18:53:28 +0000 (UTC) Received: (qmail 19159 invoked by uid 500); 6 Jul 2011 18:53:28 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 19136 invoked by uid 500); 6 Jul 2011 18:53:28 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 19128 invoked by uid 99); 6 Jul 2011 18:53:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 18:53:27 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcaddd-derby-dev@m.gmane.org designates 80.91.229.12 as permitted sender) Received: from [80.91.229.12] (HELO lo.gmane.org) (80.91.229.12) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jul 2011 18:53:20 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QeXDW-0002rC-Dr for derby-dev@db.apache.org; Wed, 06 Jul 2011 20:52:58 +0200 Received: from 238.225.34.95.customer.cdi.no ([95.34.225.238]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Jul 2011 20:52:58 +0200 Received: from kahatlen by 238.225.34.95.customer.cdi.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 06 Jul 2011 20:52:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: derby-dev@db.apache.org To: derby-dev@db.apache.org From: Knut Anders Hatlen Subject: Re: JVM memory settings for running suites.All Date: Wed, 06 Jul 2011 20:53:41 +0200 Lines: 31 Message-ID: References: <4E146309.3000906@gmail.com> <4E1489EF.2030709@sbcglobal.net> <4E14A174.6040605@sbcglobal.net> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 238.225.34.95.customer.cdi.no Mail-Copies-To: never User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (usg-unix-v) Cancel-Lock: sha1:dfa2I/dROWdVWleoCiqg+psejOc= Kathey Marsden writes: > On 7/6/2011 9:35 AM, Knut Anders Hatlen wrote: >> >> We should, but we just shut down the engine, we don't deregister the >> driver in DriverManager, so the classes stay in memory forever. It's a >> bit tricky to get the old versions unloaded. Simply calling >> DriverManager.deregisterDriver() in the test tear-down won't work, since >> it'll only let you deregister drivers in the same class loader as the >> caller, and the test framework and the old drivers are loaded in >> different class loaders. >> > If we used DataSources for the upgrade tests would we avoid this > problem or would the autoloaded driver still get loaded? I think we already use DataSources for the upgrade tests, see PhaseChanger#setUp(). In any case, EmbeddedDataSource will load EmbeddedDriver, which will register itself with the DriverManager. We can (maybe) change the EmbeddedDataSource to stop doing that, but we'd still have the problem in all the old versions we test against. One possible solution may be to create a helper class with a method that unloads the embedded driver and somehow wire this class into the class loader in which the old version is running. The helper class could be used from the test tear-down. Then we should be able to trick DriverManager into unloading the driver. I think... I've filed DERBY-5316 to track this issue. -- Knut Anders