commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Erickson" <da...@ratemod.com>
Subject Transaction - FileResourceManager
Date Mon, 03 Jan 2005 19:55:13 GMT
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


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.7 - Release Date: 12/30/2004
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message