Hi!
I have got a solution of Tomas Mahler and thought that I would share it. It
is very simple once you realise that there arn't a 1-1 relation between
class-description and database-table but a n-1. You can have as many classes
mapping to one database-table as you like and find use of.

So the solution to how to avoid an OutOfMemory error handling blobs are to
separate your class holding the blob into two. If you like me have a
Picture-class separate them into  PictureInfo and  PictureData where the
PictureInfo holds all values about the picture that are not the picture-data
while the PictureData only holds the id and data. When you need the data of
the picture let the PictureInfo-class load an object of PictureData
(lazy-loading).

Regards
Roland Carlsson



----- Original Message ----- 
From: "Roland Carlsson" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, July 30, 2003 6:47 PM
Subject: Blob and OutOfMenory


Hi!
I'm using blobs together with a byte[]. It works quite good except for one
little problem. I have 1000+ files of 1 MB and it isn't that nice to have
into ram. So what I looking for is a solution where I can keep only
referenses to an InputStream and a OutputStream from where I can reach the
data without have to store it in my classes until I use it.

I have tried to have java.sql.Blob into my classes but it doesn't seem to
work.

Thanks in advance
Roland Carlsson






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to