You and use a mixture of the two. You can represent the image information
(content type, dimensions, etc) with an Entity, and let the image data be
fetched directly from database, using a session bean (or some other bean type).

We have build a system that supports the uploading and viewing of images

View:
To retrieve the images from the database we use a servlet that reads the image
data directly form the database. To support cache of images by the browser we
make use of the getLastModified(HttpServletRequest req) of the servlet. The
main reason for the servlet, was make use of the cache from browsers, and avoid
unnecessary temporary memory allocations (the content of the image go
"directly" to the output of the response)

Store:
The store of image the image is managed by a Session bean

Some advantages using the DB:
* If you have clustered environment you don't have to bother where the images
are stored (this important when you can dynamically modify the contents, and
you don't have a shared fault tolerant file system, accessible in the cluster)
* You can control transactions in the DB, you cannot control file system
transactions
* Backup


We have used

aashish agarwal wrote:

> Hi All,
>     We are using images whose size can go upto 1MB. My first question is ,
> should we store the images in a Database (oracle) or should we just store
> the relative path for it in the Database.
> My second question( which is more relavent for this list) is since we are
> using Entitiy beans and these beans will fetch images, how does one handle
> this problem. Our image size can go upto 1MB and if multiple instances are
> there, the appliction server might crash. So, if anybody has used entity
> beans for HUGE DATA TRANSFER, then could u please guide us abt this.
> Hope , the problem is clear to you all.
> Any comments/suggestions/questions are welcome!
>
> Regards
> Aashish
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
Bruno Antunes,
Java Software Engineer

email: mailto:[EMAIL PROTECTED]
Phone: +351.21.7994200
Fax  : +351.21.7994242

WhatEverSoft - Java Center
Centro de Competencia Java
Praca de Alvalade, 6 - Piso 4
1700-036 Lisboa - Portugal
URL: http://www.whatevernet.com

****************** Internet Mail Footer ****************************
A presente mensagem pode conter Informação considerada Confidencial.
Se o receptor desta mensagem não for o destinatário indicado, fica
expressamente proibido de copiar ou endereçar a mensagem a terceiros.
Em tal situação, o receptor deverá destruir a presente mensagem e
por gentileza informar o emissor de tal facto.
--------------------------------------------------------------------
Privileged or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message,
you may not copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by
reply email.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to