From dev-return-9338-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Sat Oct 11 04:23:05 2008 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 46968 invoked from network); 11 Oct 2008 04:23:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Oct 2008 04:23:05 -0000 Received: (qmail 80158 invoked by uid 500); 11 Oct 2008 04:23:04 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 80130 invoked by uid 500); 11 Oct 2008 04:23:04 -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 80119 invoked by uid 99); 11 Oct 2008 04:23:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 21:23:04 -0700 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; Sat, 11 Oct 2008 04:22:08 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7B88C234C219 for ; Fri, 10 Oct 2008 21:22:44 -0700 (PDT) Message-ID: <445347124.1223698964504.JavaMail.jira@brutus> Date: Fri, 10 Oct 2008 21:22:44 -0700 (PDT) From: "Jeremy Bauer (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Resolved: (OPENJPA-743) OptimisticLockException persisting collection containing Lob fields with Oracle In-Reply-To: <1222237108.1223646824379.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-743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jeremy Bauer resolved OPENJPA-743. ---------------------------------- Resolution: Fixed When setting up a parameters of a prepared statement, OpenJPA sets null clob field values to an empty clob parameter type, while it sets non-null values to a character stream. When statement batching is enabled, the Oracle 1.4 driver fails to insert all the batched rows due to using mixed parameter types, even though the parameter types/values are compatible with the table column and can be inserted using separate statements. This problem no longer exists in version 11.0.7.0 of the Oracle JDK 5 JDBC driver, ojdbc5.jar. It was not, however resolved in the latest 1.4 driver, version 10.2.0.4. Preferably, get the latest ojdbc5 driver to correct the problem. If use of ojdbc14.jar is necessary, the recommended workaround is to disable statement batching. > OptimisticLockException persisting collection containing Lob fields with Oracle > ------------------------------------------------------------------------------- > > Key: OPENJPA-743 > URL: https://issues.apache.org/jira/browse/OPENJPA-743 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 1.2.0 > Environment: OpenJPA 1.2.0, Oracle 10g ojdbc14.jar, version 10.2.0.1.0 > Reporter: Jeremy Bauer > Assignee: Jeremy Bauer > > Persisting an object graph with an entity containing a persistent collection of objects which contain a Lob field may fail on Oracle if statement batching is enabled. The failure will depend on the order of operations, which can be somewhat intermittent. If more than one insert into the table containing the Lob column are batched together and there is a mix of null and non-null data value parameters, the batch insert operation will fail with an OptimisticLockException. > A simple (but not especially performance friendly) way to work around the problem is to disable statement batching via: > Otherwise, if possible, make sure all Lob fields are set to a non-null value. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.