From dev-return-7507-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Wed Feb 20 21:36:22 2008 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 94526 invoked from network); 20 Feb 2008 21:36:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2008 21:36:21 -0000 Received: (qmail 79836 invoked by uid 500); 20 Feb 2008 21:36:15 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 79803 invoked by uid 500); 20 Feb 2008 21:36:15 -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 79794 invoked by uid 99); 20 Feb 2008 21:36:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2008 13:36:15 -0800 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; Wed, 20 Feb 2008 21:35:37 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 645F2234C040 for ; Wed, 20 Feb 2008 13:35:43 -0800 (PST) Message-ID: <218407525.1203543343396.JavaMail.jira@brutus> Date: Wed, 20 Feb 2008 13:35:43 -0800 (PST) From: "Patrick Linskey (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-484) H2Dictionary has 'useGetObjectForBlobs' set to true, which should be false In-Reply-To: <15943030.1200065494979.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12570836#action_12570836 ] Patrick Linskey commented on OPENJPA-484: ----------------------------------------- This can be worked around with the following configuration setting: > H2Dictionary has 'useGetObjectForBlobs' set to true, which should be false > -------------------------------------------------------------------------- > > Key: OPENJPA-484 > URL: https://issues.apache.org/jira/browse/OPENJPA-484 > Project: OpenJPA > Issue Type: Bug > Components: jdbc, sql > Affects Versions: 1.0.1, 1.1.0 > Environment: H2 Database - v1.0.64, Java SE6 > Reporter: Prashant Bhat > > From H2 Database forum http://groups.google.com/group/h2-database/browse_thread/thread/fab7dd4424445c9b > H2Dictionary has 'useGetObjectForBlobs' set to true, whereas the default in DBDictionary is false. So for an entity with a property of type byte[] which is mapped as blob, loading fails because, the 'getBytes' method uses 'rs.getObject(column);' which fails with the following exception: > Caused by: java.lang.ClassCastException: java.io.ByteArrayInputStream cannot be cast to [B > at org.apache.openjpa.jdbc.sql.DBDictionary.getBytes(DBDictionary.java:531) > at org.apache.openjpa.jdbc.sql.ResultSetResult.getBytesInternal(ResultSetResult.java:278) > at org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(ResultSetResult.java:404) > at org.apache.openjpa.jdbc.sql.AbstractResult.getObject(AbstractResult.java:662) > at org.apache.openjpa.jdbc.meta.strats.HandlerStrategies.loadDataStore(HandlerStrategies.java:205) > at org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy.load(HandlerFieldStrategy.java:172) > at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:796) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:841) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:793) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:483) > at org.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:116) > at org.apache.openjpa.kernel.ROPStoreManager.load(ROPStoreManager.java:78) > at org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:2893) > at org.apache.openjpa.kernel.StateManagerImpl.loadField(StateManagerImpl.java:2971) > at org.apache.openjpa.kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1476) > at org.apache.openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java:1461) > I've tried setting 'useGetObjectForBlobs' to false(by just commenting it!), it is working. So please change this to false. > Thanks, -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.