Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 38384 invoked from network); 4 Jan 2005 10:24:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 4 Jan 2005 10:24:15 -0000 Received: (qmail 91327 invoked by uid 500); 4 Jan 2005 10:23:32 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 91096 invoked by uid 500); 4 Jan 2005 10:23:24 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 90944 invoked by uid 99); 4 Jan 2005 10:23:18 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of oliver.zeigermann@gmail.com designates 64.233.184.205 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.205) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 04 Jan 2005 02:23:14 -0800 Received: by wproxy.gmail.com with SMTP id 55so27344wri for ; Tue, 04 Jan 2005 02:23:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=oF+/Lf1eiFIKGDSIz+6YuZX4rHnx/rWI8wGwqZ0eh9v/W83zLn9ft74s3TcfxbXvfLA+ZPju35vuEa6Kb6xdLLX+45Mxgr1riREuzj/UmlII2klZFCuVUeRNqqL+MYINlPgRxuObgpgC6hax+h/fqJ42ZkMOjj6kZN70lgr3uok= Received: by 10.54.2.64 with SMTP id 64mr237157wrb; Tue, 04 Jan 2005 02:23:11 -0800 (PST) Received: by 10.54.11.51 with HTTP; Tue, 4 Jan 2005 02:23:11 -0800 (PST) Message-ID: <9da4f4520501040223337143a4@mail.gmail.com> Date: Tue, 4 Jan 2005 11:23:11 +0100 From: Oliver Zeigermann Reply-To: ozeigermann@apache.org To: Jakarta Commons Users List , halcyon@ratemod.com Subject: Re: Transaction - FileResourceManager In-Reply-To: <200501031954.j03Jsv903352@mmellor.whsites.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <200501031954.j03Jsv903352@mmellor.whsites.net> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Mon, 3 Jan 2005 12:55:13 -0700, David Erickson wrote: > Couple Questions regarding the new Transaction package, specifically the > FileResourceManager. > > It was a bit vague in the FRM docs, but it talked about threaded access to > the FRM object, and left me still wondering. I will be using this in a web > application, and it will have multiple threads needing access to the FRM > object, however each thread will only ever access 1 transaction at a time, > and that transaction will be created/destroyed by that thread. Is that ok? Yes. > I'm also wondering, for example I have a method on my service object: > > InputStream getFile(Long courseId, String fileName) throws > DataAccessException; > > This method is already wrapped using AOP from Spring with a transaction > manager for RBDMS access, I would like to integrate FRM into an Aspect as > well. However I'm wondering since its returning an InputStream what happens > if the transaction closes before the InputStream is read? Would I need to > move from returning a stream to returning a byte[] or something that has > been fully read from the filesystem? Is there a best approach I should use > for this type of situation? If the stream comes from the FRM and it has been opened inside a transaction it will be closed by the FRM upon commit/rollback. > Also I noticed when you instantiate a FRM you give it a base path for the > files to be stored at. Is it legal when specifying resources to read/write, > to specify a directory then the file? IE basepath /storage/content then > when I specify a read resource specify it as /5/something.wav for a total > path of /storage/content/5/something.wav? This should work. Oliver --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org