Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5986A10698 for ; Tue, 5 Nov 2013 18:33:18 +0000 (UTC) Received: (qmail 29659 invoked by uid 500); 5 Nov 2013 18:33:18 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 29610 invoked by uid 500); 5 Nov 2013 18:33:18 -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 29534 invoked by uid 99); 5 Nov 2013 18:33:18 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Nov 2013 18:33:18 +0000 Date: Tue, 5 Nov 2013 18:33:18 +0000 (UTC) From: "Albert Lee (JIRA)" To: dev@openjpa.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (OPENJPA-2449) refresh(PESSIMISTIC_WRITE) generates seperate SQL for the lock MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Albert Lee updated OPENJPA-2449: -------------------------------- Patch Info: Patch Available > refresh(PESSIMISTIC_WRITE) generates seperate SQL for the lock > -------------------------------------------------------------- > > Key: OPENJPA-2449 > URL: https://issues.apache.org/jira/browse/OPENJPA-2449 > Project: OpenJPA > Issue Type: Improvement > Components: jdbc, kernel > Affects Versions: 2.1.2, 2.2.1.1, 2.2.3, 2.3.1, 2.4.0 > Reporter: Albert Lee > Priority: Minor > Attachments: OPENJPA-2449.patch > > > Simple refresh(PESSIMISTIC_WRITE) generates multiple SQL statements. E.g. > em.refresh(t1, LockModeType.PESSIMISTIC_WRITE); > //SELECT t0.CMLT_FOLDER_CONTEXT_UPDATE_TMS, t0.CRE_TIME FROM T1 t0 WHERE t0.c1 = ? [params=(String) c1] > //SELECT t0.c1 FROM T1 t0 WHERE t0.c1 = ? FOR READ ONLY WITH RR USE AND KEEP UPDATE LOCKS [params=(String) c1] > It would be nice if a single SQL is executed to optimize SQL execution and chances that another thread may compete to lock the same row. -- This message was sent by Atlassian JIRA (v6.1#6144)