Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 85630 invoked from network); 3 Aug 2006 13:15:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Aug 2006 13:15:34 -0000 Received: (qmail 30354 invoked by uid 500); 3 Aug 2006 13:15:33 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 30325 invoked by uid 500); 3 Aug 2006 13:15:33 -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 30316 invoked by uid 99); 3 Aug 2006 13:15:32 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2006 06:15:32 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.19.6] (HELO sineb-mail-1.sun.com) (192.18.19.6) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2006 06:15:32 -0700 Received: from fe-apac-05.sun.com (fe-apac-05.sun.com [192.18.19.176] (may be forged)) by sineb-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k73DF8v1023015 for ; Thu, 3 Aug 2006 21:15:09 +0800 (SGT) Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0J3F00301BBO5S00@mail-apac.sun.com> (original mail from Anurag.Shekhar@Sun.COM) for derby-dev@db.apache.org; Thu, 03 Aug 2006 21:15:08 +0800 (SGT) Received: from [129.158.228.213] by mail-apac.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0J3F00IAUBH3LRMN@mail-apac.sun.com> for derby-dev@db.apache.org; Thu, 03 Aug 2006 21:15:08 +0800 (SGT) Date: Thu, 03 Aug 2006 18:45:03 +0530 From: Anurag shekhar Subject: Re: Using StorageFactory to create temporary files In-reply-to: <44D0DCCC.9040700@sbcglobal.net> Sender: Anurag.Shekhar@Sun.COM To: derby-dev@db.apache.org Message-id: <44D1F6D7.2090805@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <44D0C5A1.6010307@sun.com> <44D0DCCC.9040700@sbcglobal.net> User-Agent: Thunderbird 1.5.0.4 (X11/20060615) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Let me explain why I need a temporary file. I need a storage where blob/clob can be stored before writing into the table. As the size of lob can go upto 2gb its not possible to keep it in memory. I am using the temporary file to keep the byte/string in case the the size grows more than 4k. So the temporary file will be created and accessed from the jdbc driver. I decided to use StorageFactory because it already have the nessasary permission for disk i/o. In case derby is running on a special storage, the StorageFactory will be aware of it and will be able to create temporary file for that device. thanks anurag Mike Matrigali wrote: > This is an unexpected usage, this was never designed for that purpose. > It was originally designed as a module only to be used underneath the > store module. The purpose was to allow alternate implementations of > the underlying filesystem. > > I wonder why straight java i/o stream interfaces were not used? Is > there anything being provided by the StorageFactory that a direct > use of java io does not easily provide? > > I think it would be especially a bad idea to use the storage factory > on the client side of network server as it is going to draw in a lot > of other stuff not currently needed by the client jar. > > Rick Hillegas wrote: >> The patch attached to DERBY-1341 uses the StorageFactory to create a >> temporary file on behalf of the embedded JDBC layer. Is this usage >> OK? Does this violate some assumptions about what server layers are >> allowed to use the StorageFactory? >> >> Would appreciate guidance here. I am out of my depth. >> >> Thanks, >> -Rick >> >> >