Return-Path: Delivered-To: apmail-incubator-jena-users-archive@minotaur.apache.org Received: (qmail 84120 invoked from network); 3 Feb 2011 14:54:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Feb 2011 14:54:41 -0000 Received: (qmail 29585 invoked by uid 500); 3 Feb 2011 14:54:41 -0000 Delivered-To: apmail-incubator-jena-users-archive@incubator.apache.org Received: (qmail 29531 invoked by uid 500); 3 Feb 2011 14:54:39 -0000 Mailing-List: contact jena-users-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jena-users@incubator.apache.org Delivered-To: mailing list jena-users@incubator.apache.org Received: (qmail 29523 invoked by uid 99); 3 Feb 2011 14:54:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 14:54:38 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bimargulies@gmail.com designates 209.85.213.175 as permitted sender) Received: from [209.85.213.175] (HELO mail-yx0-f175.google.com) (209.85.213.175) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 14:54:32 +0000 Received: by yxd5 with SMTP id 5so504558yxd.6 for ; Thu, 03 Feb 2011 06:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=sSoFpmlEIojns1HemhFoxUX2bdJzg3/97UJ0W8Zu8nY=; b=RPkB6Z2crUX5mQ4hXxf5ZCL8UpZuiE76uTqkh8Wa5rthhHbPyVKZzMNEHKr+fqQbbS ycC3YWh+U1lGMbyBEcEcFqGcsTTWkIAlKU9gwValEPk+CIsSIlhBJHgSwyZmA2PAKYlw vjva1oDNFNRtfYHAnGGvfeXQJd6HYo5/TRgbo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=W7y/y3xM3yu8ZFzanzlLed+tt0FcPLh8eVU4NGU3vkHK2UNMKZDSQmoxq37qgPz3sm MZODUc91myJdI7knK+1nL0VTnirB/+1RcayKYrsBped/va5SLt2R/nHAD1oaD57EzBul h5CczEfjK1lTZ4RWX/WSJO+MFrMKkvCdszT+8= MIME-Version: 1.0 Received: by 10.100.106.12 with SMTP id e12mr1517620anc.113.1296744851556; Thu, 03 Feb 2011 06:54:11 -0800 (PST) Received: by 10.100.125.7 with HTTP; Thu, 3 Feb 2011 06:54:11 -0800 (PST) In-Reply-To: <4D4A73C0.6020904@epimorphics.com> References: <4D4A73C0.6020904@epimorphics.com> Date: Thu, 3 Feb 2011 09:54:11 -0500 Message-ID: Subject: Re: TDB in a unit test -- or -- when is a close not a close? From: Benson Margulies To: jena-users@incubator.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Is there a way to enable fixed.opt? On Thu, Feb 3, 2011 at 4:22 AM, Andy Seaborne wrote: > Ah - good old 4724038 [1]. =C2=A0Currently #4 in the Java RFE hit parade = [2] > despite the fact most people call it a bug. > > Summary: It's a Windows-ism to do with "deleting" memory mapped files. Th= ey > are still mapped by the OS. > > I've not tried the GC/loop dance. The cleaner workaround does not look li= ke > it will work on other JVMs which will concern some users. > > There is an in-memory TDB version. =C2=A0Good for testing, not a performa= nt > replacement for memory models - the TDB memory dataset uses a > copy-in/copy-out RAM disk for true disk semantics. > > The magic location name is "--mem--" or there are TDBFactory operations t= hat > take no location. > > =C2=A0 =C2=A0 =C2=A0 =C2=A0Andy > > [1] http://bugs.sun.com/view_bug.do?bug_id=3D4724038 > [2] http://bugs.sun.com/top25_rfes.do > > On 03/02/11 02:47, Benson Margulies wrote: >> >> We can't get a unit test on Windows to delete a temporary TDB. >> >> Now, on the one hand, I saw some code that suggests that with the >> right assembly descriptor I could have a completely in-memory TDB and >> avoid this. >> >> But, on the other hand, I would think that with a System.gc() and a >> sleep, we could do this, in spite of Java's annoying lazyiness about >> closing the backing files of memory mapped files. >> >> How confident are you that all the channels and streams get closed? > > As confident as I can be. > > There is a known problem deleting datasets on Windows 64 bit because of t= he > memory mapped file issue. =C2=A0FileMode.direct works. > >