Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 68543 invoked from network); 1 Oct 2008 16:30:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Oct 2008 16:30:05 -0000 Received: (qmail 83082 invoked by uid 500); 1 Oct 2008 16:30:03 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 83056 invoked by uid 500); 1 Oct 2008 16:30:03 -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 83045 invoked by uid 99); 1 Oct 2008 16:30:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2008 09:30:03 -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; Wed, 01 Oct 2008 16:29:09 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4B3D9234C1F9 for ; Wed, 1 Oct 2008 09:29:44 -0700 (PDT) Message-ID: <2041650471.1222878584307.JavaMail.jira@brutus> Date: Wed, 1 Oct 2008 09:29:44 -0700 (PDT) From: "Fay Wang (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Assigned: (OPENJPA-736) Combine insert and select SQL together when for generated Id with strategy=GenerationType.IDENTITY In-Reply-To: <2019546525.1222878584214.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-736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fay Wang reassigned OPENJPA-736: -------------------------------- Assignee: Fay Wang > Combine insert and select SQL together when for generated Id with strategy=GenerationType.IDENTITY > ---------------------------------------------------------------------------------------------------- > > Key: OPENJPA-736 > URL: https://issues.apache.org/jira/browse/OPENJPA-736 > Project: OpenJPA > Issue Type: Improvement > Affects Versions: 1.3.0 > Reporter: Fay Wang > Assignee: Fay Wang > Fix For: 1.3.0 > > > Currently if the strategy of the generated id is GenerationType.IDENTITY, when an entity object is created, openjpa will generate two SQL statements. The following is an example running on DB2: > (1) INSERT INTO EntityA (col1, col2, col3, version) VALUES (?, ?, ?, ?) > [params=(int) 1, (int) 1, (int) 1, (int) 1] > (2) SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1 > A performance improvement is to take advantage of the "select from final table" feature in DB2 to combine the insert and select statement into a single SQL statement as shown below: > SELECT id FROM FINAL TABLE (INSERT INTO EntityA (col1, col2, col3, version) VALUES (?, ?, ?, ?) ) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.