From dev-return-7583-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Fri Mar 07 04:12:14 2008 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 37925 invoked from network); 7 Mar 2008 04:12:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Mar 2008 04:12:14 -0000 Received: (qmail 85546 invoked by uid 500); 7 Mar 2008 04:12:11 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 85520 invoked by uid 500); 7 Mar 2008 04:12:10 -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 85511 invoked by uid 99); 7 Mar 2008 04:12:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Mar 2008 20:12:10 -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; Fri, 07 Mar 2008 04:11:43 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E3BE3234C03E for ; Thu, 6 Mar 2008 20:10:57 -0800 (PST) Message-ID: <276795870.1204863057918.JavaMail.jira@brutus> Date: Thu, 6 Mar 2008 20:10:57 -0800 (PST) From: "Albert Lee (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Resolved: (OPENJPA-530) Statement batching incorrectly re-arranged order of SQL statements organized by update managers In-Reply-To: <746945525.1204507250331.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-530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Albert Lee resolved OPENJPA-530. -------------------------------- Resolution: Fixed > Statement batching incorrectly re-arranged order of SQL statements organized by update managers > ----------------------------------------------------------------------------------------------- > > Key: OPENJPA-530 > URL: https://issues.apache.org/jira/browse/OPENJPA-530 > Project: OpenJPA > Issue Type: Bug > Components: jdbc > Affects Versions: 1.1.0 > Reporter: Albert Lee > Assignee: Albert Lee > Fix For: 1.1.0 > > Attachments: OPENJPA-530.patch > > > BatchingPreparedStatementManagerImpl implements the core SQL statement execution function of the Statement Batching features. > The current implementation of this class holds a cache that maps SQL prepared statements to a collection of parameters of batched requests for that prepared statement. When update manager finishes batching its requests, BatchingPreparedStatementManagerImpl.flush() method is called to submit the batch elements in the cache to the jdbc driver. > Essentially, this implementation discards all the ordering of statements being dispatched to the statement batching function by the update manager. This caused improper order of SQL statements to be sent to the data store. As a result, the underlying database may throw exception indicates the unexpected data condition. E.g. > com.ibm.db2.jcc.b.SqlException: Error for batch element #2: DB2 SQL error: SQLCODE: -530, SQLSTATE: 23503, SQLERRMC: LEEALBER.EMPBEAN.SQL080226132752530 > SQL0530N: The insert or update value of the FOREIGN KEY constraint-name is not equal to any value of the parent key of the parent table. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.