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 7991F200D51 for ; Thu, 23 Nov 2017 05:25:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7812B160C0F; Thu, 23 Nov 2017 04:25:05 +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 961D9160BFD for ; Thu, 23 Nov 2017 05:25:04 +0100 (CET) Received: (qmail 53285 invoked by uid 500); 23 Nov 2017 04:25:03 -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 53275 invoked by uid 99); 23 Nov 2017 04:25:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Nov 2017 04:25:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D6BD0C181E for ; Thu, 23 Nov 2017 04:25:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.011 X-Spam-Level: X-Spam-Status: No, score=-99.011 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KB_WAM_FROM_NAME_SINGLEWORD=0.2, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id VMVcfHybDw3C for ; Thu, 23 Nov 2017 04:25:01 +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 1C5665F576 for ; Thu, 23 Nov 2017 04:25:01 +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 4E4EAE0237 for ; Thu, 23 Nov 2017 04:25:00 +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 0E1072419F for ; Thu, 23 Nov 2017 04:25:00 +0000 (UTC) Date: Thu, 23 Nov 2017 04:25:00 +0000 (UTC) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6975) ERROR 40XL1: A lock could not be obtained within the time requested MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 23 Nov 2017 04:25:05 -0000 [ https://issues.apache.org/jira/browse/DERBY-6975?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1626= 3798#comment-16263798 ]=20 Rick Hillegas commented on DERBY-6975: -------------------------------------- Hey David, I'm sorry for my tardy response. I did not see your comment at the end of O= ctober. It looks like you have tripped across DERBY-6934. Since only one thread is = inserting at a time and it seems to be inserting only one row at a time, th= en I think that the following workaround may be sufficient: 1) Don't use getGeneratedKeys(). It doesn't work properly and it causes the= se lock collisions. 2) Instead, after each row is inserted, call SYSCS_UTIL.SYSCS_PEEK_AT_IDENT= ITY() to find the next value which the identity generator will produce. The= identity value you just inserted should be the value of SYSCS_UTIL.SYSCS_P= EEK_AT_IDENTITY() minus the quantity by which the identity generator increm= ents each time (that's probably the default value of 1). Let me know if this works or if you are still having trouble. I will try to= do a better job of checking this issue for new activity. Hope this helps, -Rick > ERROR 40XL1: A lock could not be obtained within the time requested=20 > -------------------------------------------------------------------- > > Key: DERBY-6975 > URL: https://issues.apache.org/jira/browse/DERBY-6975 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.14.1.0 > Reporter: David Sitsky > > I have an application that when run on a certain dataset, every 5 runs I = might see this error happening. The code is creating a lot of rows using a= sequence generator. > {noformat} > Caused by: ERROR 40XL1: A lock could not be obtained within the time requ= ested=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.iapi.error= .StandardException.newException(StandardException.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.iapi.error= .StandardException.newException(StandardException.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.c= atalog.SequenceUpdater.tooMuchContentionException(SequenceUpdater.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.c= atalog.SequenceUpdater.getCurrentValueAndAdvance(SequenceUpdater.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.c= atalog.DataDictionaryImpl.getCurrentValueAndAdvance(DataDictionaryImpl.java= )=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.e= xecute.BaseActivation.getCurrentValueAndAdvance(BaseActivation.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.e= xecute.InsertResultSet.getSetAutoincrementValue(InsertResultSet.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.e= xecute.BaseActivation.getSetAutoincrementValue(BaseActivation.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.exe.ac5607= 40aax015fx6bc1x68cax000002339e626a.e0(ac560740aax015fx6bc1x68cax000002339e6= 26a.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.servi= ces.reflect.DirectCall.invoke(DirectCall.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.e= xecute.RowResultSet.getNextRowCore(RowResultSet.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.e= xecute.NormalizeResultSet.getNextRowCore(NormalizeResultSet.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.e= xecute.DMLWriteResultSet.getNextRowCore(DMLWriteResultSet.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.e= xecute.InsertResultSet.getNextRowCore(InsertResultSet.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.e= xecute.InsertResultSet.open(InsertResultSet.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.G= enericPreparedStatement.executeStmt(GenericPreparedStatement.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 at org.apache.derby.impl.sql.G= enericPreparedStatement.execute(GenericPreparedStatement.java)=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ... 25 more=20 > {noformat} > It is not clear to me why when looking at the code this should be happeni= ng. =20 -- This message was sent by Atlassian JIRA (v6.4.14#64029)