Uploaded image for project: 'Pentaho Analysis - Mondrian'
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-557

ConcurrentModificationException when multiple threads try and create Mondrian connections

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Medium
    • Resolution: Fixed
    • Affects Version/s: 3.1 GA
    • Fix Version/s: 3.1.5 GA
    • Component/s: Aggregation Tables
    • Labels:
      None
    • Environment:
      Java6
      Ubuntu Jaunty
      Mondrian 3.0.4
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      The reporting system that shows this problem pools it's datasources which are then provided to the DriverManager when getting an olap connection, multiple threads can be accessing this function (which obtains the Mondrian Connection) at any given time. The problem produces the following exception in the log:
      java.util.ConcurrentModificationException
      at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1100)
      at java.util.TreeMap$ValueIterator.next(TreeMap.java:1145)
      at
      mondrian.rolap.aggmatcher.AggTableManager.loadRolapStarAggregates(AggTableManager.java:226)
      at
      mondrian.rolap.aggmatcher.AggTableManager.initialize(AggTableManager.java:94)
      at mondrian.rolap.RolapSchema.load(RolapSchema.java:343)
      at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:216)
      at mondrian.rolap.RolapSchema.<init>(RolapSchema.java:79)
      at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:834)
      at mondrian.rolap.RolapSchema$Pool.get(RolapSchema.java:746)
      at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:159)
      at mondrian.rolap.RolapConnection.<init>(RolapConnection.java:83)
      at mondrian.olap.DriverManager.getConnection(DriverManager.java:110)
      at
      com.<CONFIDENTIAL>.service.providers.ras.RASProvider.getMondrianConnection(RASProvider.java:468)

      Ultimately this problem comes from the JdbcSchema class that has a member variable called tables which is initialized on line 1104 as follows: private final SortedMap<String, Table> tables = new TreeMap<String, Table>();
      TreeMap is not a synchronized object and would need to be initialized as follows:
      private final SortedMap<String, Table> tables = (SortedMap)Collections.synchronizeMap(new TreeMap<String, Table>());

      This problem does not show up consistently, however regularly enough that it causes problems when trying to load reports that have data from the Olap cube, and the more users that are using the system causing it to show up more frequently. Unless I am missing something this seems like a fairly straight forward thing to fix.

        Attachments

          Activity

            People

            • Assignee:
              project admin Triage
              Reporter:
              michaelc Michael Cuthbert
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: