From dev-return-15471-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Mon Mar 08 20:26:15 2010 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 58441 invoked from network); 8 Mar 2010 20:26:15 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Mar 2010 20:26:15 -0000 Received: (qmail 45080 invoked by uid 500); 8 Mar 2010 20:25:50 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 45018 invoked by uid 500); 8 Mar 2010 20:25:50 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 45010 invoked by uid 99); 8 Mar 2010 20:25:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Mar 2010 20:25:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Mar 2010 20:25:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 32CC6234C48D for ; Mon, 8 Mar 2010 20:25:27 +0000 (UTC) Message-ID: <1476219140.141611268079927196.JavaMail.jira@brutus.apache.org> Date: Mon, 8 Mar 2010 20:25:27 +0000 (UTC) From: "Donald Woods (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-740) In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data. In-Reply-To: <682946068.1223417805707.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842805#action_12842805 ] Donald Woods commented on OPENJPA-740: -------------------------------------- Thanks Milosz, I just added a check for size==0 so it'll use the old blob size (64KB). For those cases, users should use your prior comment of overriding the blobTypeName. > In MySQL use LONGBLOB, MEDIUMBLOB etc.. when needed, cause BLOB only holds 64kb of data. > ---------------------------------------------------------------------------------------- > > Key: OPENJPA-740 > URL: https://issues.apache.org/jira/browse/OPENJPA-740 > Project: OpenJPA > Issue Type: Bug > Components: sql > Affects Versions: 1.2.0, 1.2.1, 1.2.2, 1.3.0, 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2 > Reporter: Simone Gianni > Assignee: Donald Woods > Priority: Blocker > Fix For: 1.3.0, 2.0.0 > > Attachments: OPENJPA-740-13x.patch, OPENJPA-740-mysqlblob.patch, OPENJPA-740-trunk.patch > > > When a column is annotated as a BLOB of using @Persistent to use streaming blobs, and the underlying database is MySQL, OpenJPA will create a column of type BLOB. Unfortunately, in MySQL a BLOB column can hold a (vary) limited amount of data, while (especially when using streaming blobs) the user would probably expect it to hold a large amount of data. > Also adding the @Column annotation and specifying a size bigger than what a BLOB column in MySQL can hold, OpenJPA still creates only a BLOB column. > I think OpenJPA should be able to create the proper column type depending on the @Column annotation if present, or otherwise default at least to a MEDIUMBLOB to preserve cross-database compatibility as expected. > The simplest patch i can think of is setting blobTypeName="MEDIUMBLOB" in the MySQLDictionary constructor. > Otherwise, overriding the getTypeName to properly parse the length and return the correct BLOB/TEXT type for mysql. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.