Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-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 A6F9B9BB7 for ; Mon, 6 Feb 2012 13:14:24 +0000 (UTC) Received: (qmail 96359 invoked by uid 500); 6 Feb 2012 13:14:24 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 96266 invoked by uid 500); 6 Feb 2012 13:14:23 -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 96259 invoked by uid 99); 6 Feb 2012 13:14:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 13:14:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 13:14:19 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 24AF9CBA7C for ; Mon, 6 Feb 2012 13:13:59 +0000 (UTC) Date: Mon, 6 Feb 2012 13:13:59 +0000 (UTC) From: "Jon Steinich (Commented) (JIRA)" To: derby-dev@db.apache.org Message-ID: <438543696.1939.1328534039152.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <471417969.11692.1328380074782.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DERBY-5603) EmbedConnection.clearLOBMapping() incorrectly clears lobFiles causing a ConcurrentModificationException 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/DERBY-5603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13201263#comment-13201263 ] Jon Steinich commented on DERBY-5603: ------------------------------------- I haven't verified a simple reproduce case, but pre-patch it should have failed whenever there was more than one entry in the lobFIles Set, so I believe creating 2 blobs in a single transaction would cause it. > EmbedConnection.clearLOBMapping() incorrectly clears lobFiles causing a ConcurrentModificationException > ------------------------------------------------------------------------------------------------------- > > Key: DERBY-5603 > URL: https://issues.apache.org/jira/browse/DERBY-5603 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.5.1.1, 10.8.2.2 > Environment: Win 7 64 bit > JDK 1.6.0_24 > Reporter: Jon Steinich > Assignee: Kristian Waagan > Priority: Critical > Attachments: derby-5603-1a-avoid_concurrentmodification.diff > > Original Estimate: 1h > Remaining Estimate: 1h > > In EmbedConnection.clearLOBMapping() the code which iterates over lobFiles has a finally block which clears the Set. This causes a ConcurrentModificationException to be thrown and even using a concurrent data structure would still result in only one LOBFile being correctly closed. > This will occur anytime the lobFiles Set contains more than 1 LOBFile. > Stack Trace: > java.sql.SQLException: Java exception: ': java.util.ConcurrentModificationException'. > at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) > at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) > at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source) > at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) > at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedConnection.commit(Unknown Source) > > Caused by: java.sql.SQLException: Java exception: ': java.util.ConcurrentModificationException'. > at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) > at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) > ... 16 more > Caused by: java.util.ConcurrentModificationException > at java.util.HashMap$HashIterator.nextEntry(Unknown Source) > at java.util.HashMap$KeyIterator.next(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedConnection.clearLOBMapping(Unknown Source) > ... 10 more -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira