Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 61945 invoked from network); 12 Aug 2009 09:35:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Aug 2009 09:35:03 -0000 Received: (qmail 1150 invoked by uid 500); 12 Aug 2009 09:35:10 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 1064 invoked by uid 500); 12 Aug 2009 09:35:10 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 1044 invoked by uid 99); 12 Aug 2009 09:35:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Aug 2009 09:35:08 +0000 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.6.24] (HELO gmp-eb-inf-2.sun.com) (192.18.6.24) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Aug 2009 09:34:56 +0000 Received: from fe-emea-10.sun.com (gmp-eb-lb-1-fe1.eu.sun.com [192.18.6.7] (may be forged)) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n7C9YL1w017019 for ; Wed, 12 Aug 2009 09:34:34 GMT MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) id <0KO900J00AY19500@fe-emea-10.sun.com> for derby-user@db.apache.org; Wed, 12 Aug 2009 10:34:11 +0100 (BST) Received: from [129.159.139.223] ([unknown] [129.159.139.223]) by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) with ESMTPSA id <0KO900JFGBWYEX30@fe-emea-10.sun.com> for derby-user@db.apache.org; Wed, 12 Aug 2009 10:34:10 +0100 (BST) Date: Wed, 12 Aug 2009 11:32:17 +0200 From: Kristian Waagan Subject: Re: What is default size of Derby Blob filed? In-reply-to: <24931884.post@talk.nabble.com> Sender: Kristian.Waagan@Sun.COM To: Derby Discussion Message-id: <4A828C21.6040607@Sun.COM> References: <24927200.post@talk.nabble.com> <4A8261AF.1050706@Sun.COM> <24931884.post@talk.nabble.com> User-Agent: Thunderbird 2.0.0.21 (X11/20090623) X-Virus-Checked: Checked by ClamAV on apache.org 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]). Regards, -- Kristian [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 >>> >>> >> >> > >