cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Best Practice for blobs
Date Thu, 03 Oct 2019 06:05:06 GMT
I wanted to have attributes that can be tagged as "lazily-loaded" like relationships, but that's
not a feature yet. So what Ari said is the easiest solution. 

Another idea is to map the column as "java.sql.Blob", which is normally just a data locator
that can stream data on demand. Though I suspect you will need to wrap both SELECT, and your
Blob streaming code in the same transaction. Also the behavior of this will likely vary between
DB engines. 

Disclaimer: I never tried it myself.


> On Oct 3, 2019, at 3:43 AM, Aristedes Maniatis <> wrote:
> My solution has been to store the blob in a separate joined table or (better) put it
in external storage like S3.
> Ari
> On 3/10/19 9:55am, Lon Varscsak wrote:
>> Hey all,
>> I have a blob column in an entity, but I don't want to always actually load
>> the blob, just on demand (but I still want to be able to see the other
>> attributes in the entity).  Any best practice here to have the blob be lazy?
>> Thanks,
>> Lon

View raw message