db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: What is default size of Derby Blob filed?
Date Wed, 12 Aug 2009 09:32:17 GMT
sarah.kho wrote:
> Hi,
> Thank you for reply.
> I used    @Column(columnDefinition="blob(6M)") and it is working like a
> horse now.

Glad to hear that :)

I was thinking of using @Column(length=...), but your approach works 
just as well. I'm curious if JPA will use metadata to obtain the maximum 
allowed length, or if it leaves all length-checking to the database itself.

Note that Derby doesn't reserve space for LOBs, so if there is a chance 
your LOBs will be larger than 6M it shouldn't hurt to allow larger objects.
It is currently not possible to change the maximum allowed size of a LOB 
column in Derby, but this feature will be included in the next feature 
release (see DERBY-4256 [1]).


[1] https://issues.apache.org/jira/browse/DERBY-4256
> Thanks for the tip.
> Kristian Waagan-4 wrote:
>> sarah.kho wrote:
>>> Hi
>>> I am trying to develop an application using JPA and derby.
>>> I have a blob filed (@Lob) in one of my entities. When it creates the
>>> field
>>> in the corresponding table it sets the size of the BLOB filed to 64k, I
>>> am
>>> wondering whether it is a Derby default or it is something related to
>>> JPA.
>> Hello Sarah,
>> This looks like a value set by JPA to me.
>> In Derby, the maximum allowed length of a Blob is used as the default. 
>> This is 2G-1 (2,147,483,647 bytes).
>> You're not saying which JPA-provider you're using, but does it work to 
>> use the @Column annotation to specify the length of the LOB?
>> Regards,
>> -- 
>> Kristian
>>> Thanks

View raw message