Derby
  1. Derby
  2. DERBY-5603

EmbedConnection.clearLOBMapping() incorrectly clears lobFiles causing a ConcurrentModificationException

    Details

    • Urgency:
      Urgent
    • Bug behavior facts:
      Crash

      Description

      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)
      <lines removed>
      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

        Issue Links

          Activity

          Jon Steinich created issue -
          Kristian Waagan made changes -
          Field Original Value New Value
          Assignee Kristian Waagan [ kristwaa ]
          Kristian Waagan made changes -
          Link This issue is broken by DERBY-3655 [ DERBY-3655 ]
          Kristian Waagan made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Kristian Waagan made changes -
          Kristian Waagan made changes -
          Issue & fix info Patch Available [ 10102 ]
          Mamta A. Satoor made changes -
          Labels derby_triage10_9
          Kristian Waagan made changes -
          Fix Version/s 10.9.0.0 [ 12316344 ]
          Issue & fix info Patch Available [ 10102 ]
          Kristian Waagan made changes -
          Affects Version/s 10.7.1.1 [ 12315564 ]
          Affects Version/s 10.6.2.1 [ 12315343 ]
          Affects Version/s 10.5.3.0 [ 12314117 ]
          Affects Version/s 10.4.2.0 [ 12313345 ]
          Affects Version/s 10.3.3.0 [ 12313142 ]
          Affects Version/s 10.5.1.1 [ 12313771 ]
          Kristian Waagan made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 10.3.3.1 [ 12313143 ]
          Fix Version/s 10.4.2.1 [ 12313401 ]
          Fix Version/s 10.5.3.2 [ 12315436 ]
          Fix Version/s 10.6.2.3 [ 12315434 ]
          Fix Version/s 10.7.1.4 [ 12315902 ]
          Fix Version/s 10.8.2.3 [ 12318540 ]
          Resolution Fixed [ 1 ]
          Kathey Marsden made changes -
          Fix Version/s 10.8.3.0 [ 12323456 ]
          Fix Version/s 10.8.2.3 [ 12318540 ]
          Gavin made changes -
          Workflow jira [ 12651920 ] Default workflow, editable Closed status [ 12802134 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Kristian Waagan
              Reporter:
              Jon Steinich
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development