commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnaud Masson ...@kikamedical.com>
Subject Re: Transaction - FileResourceManager
Date Tue, 04 Jan 2005 08:33:38 GMT
I had the same problem in another framework and I just wrote something like:

void getFile(Long courseId, String fileName, OutputStream clientOut) throws
DataAccessException;



 proDavid 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?
>
> 
>
>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?  
>
> 
>
>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?
>
> 
>
>Thanks in advance and great work!
>
>-David
>
>
>  
>



Mime
View raw message