Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CDD3B200C75 for ; Sun, 21 May 2017 20:42:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C7BCE160BC5; Sun, 21 May 2017 18:42:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BE5E5160BBC for ; Sun, 21 May 2017 20:42:11 +0200 (CEST) Received: (qmail 24068 invoked by uid 500); 21 May 2017 18:42:11 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 24057 invoked by uid 99); 21 May 2017 18:42:10 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 May 2017 18:42:10 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 8AF4C190D5D for ; Sun, 21 May 2017 18:42:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ks2IQn_aVcxn for ; Sun, 21 May 2017 18:42:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id E429B5F2FD for ; Sun, 21 May 2017 18:42:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id F1447E05CE for ; Sun, 21 May 2017 18:42:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id DFC4921B56 for ; Sun, 21 May 2017 18:42:04 +0000 (UTC) Date: Sun, 21 May 2017 18:42:04 +0000 (UTC) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6934) Lock conflicts between Statement.getGeneratedKeys() and sequence-generator-based identity columns MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 21 May 2017 18:42:13 -0000 [ https://issues.apache.org/jira/browse/DERBY-6934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16018947#comment-16018947 ] Bryan Pendleton commented on DERBY-6934: ---------------------------------------- Hi Rick, Some of the issues you're exploring with Statement.getGeneratedKeys seem very similar to the discussions we had in DERBY-6849 and DERBY-3609. It might be worth looking back over those notes as part of the exercise you're engaged in now? > Lock conflicts between Statement.getGeneratedKeys() and sequence-generator-based identity columns > ------------------------------------------------------------------------------------------------- > > Key: DERBY-6934 > URL: https://issues.apache.org/jira/browse/DERBY-6934 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.13.1.1 > Reporter: Rick Hillegas > Attachments: Derby_6934.java, IVL.java > > > Lock conflicts between Statement.getGeneratedKeys() and sequence-generator-based identity columns > Statement.getGeneratedKeys() is implemented on top of IDENTITY_VAL_LOCAL(), which does not play well with sequence generators. This is a problem for applications built on top of Hibernate. That is because Hibernate calls Statement.getGeneratedKeys() after inserting into a table with an identity-generator. This issue was raised on the following email thread: http://apache-database.10148.n7.nabble.com/Identity-column-and-40XL1-error-td147382.html > To see the lock contention, put IVL and derby.jar on the classpath and run the program like this: > java IVL 10 100 > That will start up 10 threads, each inserting 100 times into a table with an identity column and then calling Statement.getGeneratedKeys(). Here is sample output from that experiment: > {noformat} > Running experiment with 10 threads and 100 inserts per thread. > Preparing 'create table t > ( > keyCol bigint generated always as identity, > threadIDCol varchar(50), > counterCol int > )'... > Starting thread0 > Starting thread1 > Starting thread2 > Starting thread3 > Starting thread4 > Starting thread5 > Starting thread6 > Starting thread7 > Starting thread8 > Starting thread9 > thread9 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread8 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread8 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread8 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread8 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread8 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread8 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread8 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread7 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread5 caught exception A lock could not be obtained within the time requested > thread5's last good key was 797 > thread8 caught exception A lock could not be obtained within the time requested > thread4 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread8 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread0 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread8 caught exception A lock could not be obtained within the time requested > thread1 caught exception A lock could not be obtained within the time requested > thread3 caught exception A lock could not be obtained within the time requested > thread2 caught exception A lock could not be obtained within the time requested > thread9 caught exception A lock could not be obtained within the time requested > thread6 caught exception A lock could not be obtained within the time requested > thread8 caught exception A lock could not be obtained within the time requested > thread1's last good key was 813 > thread0 caught exception A lock could not be obtained within the time requested > thread3's last good key was 826 > thread4's last good key was 830 > thread0's last good key was 838 > thread9's last good key was 840 > thread2's last good key was 842 > thread8's last good key was 843 > thread7's last good key was 846 > thread6's last good key was 849 > Done! > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)