Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Pattern »

Re: Strategies for Streaming large Files?!

Stefan Frank

2004-04-27

Replies:

Hi Kris,

yes, actually that was the solution we finally came up with, but it
actually side-stepped our J2EE-Server: We have very large Image-Files
(up to 2GB), that comprise 3 dimensions over time(biological Imaging) -
the files now reside in the file-system and get memory-mapped with a
simple api (getPlane(x,y,z, timestep, wave-length) and returns the raw
pixels over http. For performance-reasons, this runs over apache and
some simple c-programs. Only the metadata runs over J2EE (basically some
navigation till you end up with the url for your image that you then
pass to apache) - this works&and is practical and we finally decided to
implement only some basic transactional behaviour (You create the
image-Placeholder in the J2EE-Server, set its content to pending, and
commit manually when the pixels have all been streamed to apache.) This
is fine and behaves nicely, as the transactions would have run very long
(streaming 2gigs of pixels takes a while). This seems to be one of the
topics, J2ee is not really well suited for, so using a second
non-j2ee-server looks like the only feasible solution.

cheers
stf

RamaKrishna N wrote:
> HI stefan,
>
> If all you are interesting in is reading files, you should use URLs.
> May be you would want to use javax.activation.URLDataSource (though it is meant for a different purpose).
>
> ..my 2 cents
>
> regards,
> kris
>
> -----Original Message-----
> From: Stefan Frank [mailto:s.frank@(protected)]
> Sent: Wednesday, March 31, 2004 9:31 PM
> To: J2EEPATTERNS-INTEREST@(protected)
> Subject: Strategies for Streaming large Files?!
>
>
> Hi,
>
> we are currently building an Imaging-Database, which will store huge
> quantities of Binary Data in the Database. Along with these Images, we
> will store Meta-Data about the Images, which we can pass as usual as a
> TransferObject to some SessionBeans that deal with Persistence. This
> works fine for the Meta-Data, for the Images, we want to be able to
> stream them to and from the Database - are there any patterns for this
> existing?! We can circumvent the EJB-Layer completely, by just taking a
> http-stream and streaming its contents directly into the DB - but if it
> was only for the sake of symetry, I'd prefer to pass the Stream to a
> SessionBean for Persistence. Has anyone tried something like this in j2ee?!
>
> Cheers
> stf
>
> ====================================================================
> Companion Site: http://www.corej2eepatterns.com
> J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
> List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
> Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
>
> ====================================================================
> Companion Site: http://www.corej2eepatterns.com
> J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
> List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
> Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
>
>

====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.