Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 45634 invoked from network); 28 Oct 2007 14:08:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Oct 2007 14:08:14 -0000 Received: (qmail 78536 invoked by uid 500); 28 Oct 2007 14:01:03 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 78510 invoked by uid 500); 28 Oct 2007 14:01: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 78501 invoked by uid 99); 28 Oct 2007 14:01:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Oct 2007 07:01:03 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Oct 2007 14:01:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9014A714204 for ; Sun, 28 Oct 2007 07:00:50 -0700 (PDT) Message-ID: <10126878.1193580050580.JavaMail.jira@brutus> Date: Sun, 28 Oct 2007 07:00:50 -0700 (PDT) From: "Michael Dick (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-423) Deadlock victim exception getting sequence value with SQLServer In-Reply-To: <14372102.1193579930597.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-423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Dick updated OPENJPA-423: --------------------------------- Attachment: OPENJPA-423.patch.txt > Deadlock victim exception getting sequence value with SQLServer > --------------------------------------------------------------- > > Key: OPENJPA-423 > URL: https://issues.apache.org/jira/browse/OPENJPA-423 > Project: OpenJPA > Issue Type: Bug > Affects Versions: 0.9.6, 0.9.7, 1.0.0 > Reporter: Michael Dick > Assignee: Michael Dick > Fix For: 1.0.1, 1.1.0 > > Attachments: OPENJPA-423.patch.txt > > > Opening a JIRA issue for the following problem, originally posted to openjpa-dev mailing list. > I've run into tricky issue with Sequence tables on SQLServer. > After some time during a stress test I get this exception when trying to update the sequence table: > openjpa.jdbc.SQL: Trace: executing prepstmnt 4953425 SELECT SEQUENCE_VALUE FROM OPENJPA_SEQUENCE_TABLE WHERE ID = ? [params=(int) 0] > . . . > openjpa.jdbc.SQL: Trace: executing prepstmnt 19626156 UPDATE OPENJPA_SEQUENCE_TABLE SET SEQUENCE_VALUE = ? WHERE ID = ? AND SEQUENCE_VALUE = ? [params=(long) 48601, (int) 0, (long) 48551] > . . . > java.sql.SQLException: [IBM][SQLServer JDBC Driver][SQLServer]Transaction (Process ID 85) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. > at com.ibm.websphere.jdbc.base.BaseExceptions.createException(Unknown Source) > at com.ibm.websphere.jdbc.base.BaseExceptions.getException(Unknown Source) > . . . > at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate (DelegatingPreparedStatement.java:269) > at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:856) > I believe I'm hitting the exception because SQLServer doesn't support the FOR UPDATE clause. Normally the first SQL statement shown above would have locked the row preventing the deadlock. SQLServer does support the WITH (UPDLOCK) hint, but I haven't found a convenient way to isolate the change so that it only affects TableSequences. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.