db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epdv <peter.nabbef...@gmx.de>
Subject Re: How to read blobs?
Date Fri, 06 Mar 2009 11:37:20 GMT
Kristian Waagan schrieb:
> epdv wrote:
>> Kristian Waagan schrieb:
>>> epdv wrote:
>> If I understand correctly, I'll need to open one connection per opened
>> (not yet closed) stream then. How can I open a pooled connection then,
>> without using J2EE (can only find docs for j2ee ... :-( )?
> I'm not sure I understand.
> You can have streams from many Blobs open as long as you don't commit or
> abort the transaction.

If I'm using one dedicated connection for reading only, will I ever need 
to commit/rollback?

> If you want to access the Blob content after you have called
> Blob.free(), you have to make a local copy of the Blob - for instance
> copying the content into a byte array and then create a
> ByteArrayInputStream.

Inappropriate, as some large blobs will be read, thus duplicating data 
is no good option.

> Maybe someone can give you some hints if you describe what you actually
> want to do. Why do you need to access the Blob after you have freed it?
> Maybe there's no need to do that, and you just need to slightly adjust
> the way you are processing the data.

I want to use derby as a buffer for network data, as at least windows 
seems to do some big overhead for remote file access.

Needing access to about 70,000 files, some of the about some bytes, 
others about 50MB. Using streams seems to be a good idea, as the app 
which should work with the files seems to prefer streams in many cases.

> My first advice would be to make your code work with autocommit turned off.

If possible, I'll do so :-)

Kind regards


> Regards,

View raw message