Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-2224

A ClassCastException occurs while attempting to execute a local query in transaction on a client

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • querying
    • None

    Description

      Code:

      CacheTransactionManager cacheTransactionManager = cache.getCacheTransactionManager();
      QueryService localQueryService = ((ClientCache) this.cache).getLocalQueryService();
      cacheTransactionManager.begin();
      Query query = queryService.newQuery(QUERY_STRING);
      SelectResults results = (SelectResults) query.execute(PARAMETERS);
      cacheTransactionManager.commit();
      

      Exception:

      Exception in thread "main" java.lang.ClassCastException: org.apache.geode.internal.cache.EntrySnapshot cannot be cast to org.apache.geode.internal.cache.LocalRegion$NonTXEntry
      	at org.apache.geode.internal.cache.EntriesSet$EntriesIterator.moveNext(EntriesSet.java:179)
      	at org.apache.geode.internal.cache.EntriesSet$EntriesIterator.<init>(EntriesSet.java:118)
      	at org.apache.geode.internal.cache.EntriesSet.iterator(EntriesSet.java:83)
      	at org.apache.geode.cache.query.internal.ResultsCollectionWrapper.iterator(ResultsCollectionWrapper.java:183)
      	at org.apache.geode.cache.query.internal.QRegion.iterator(QRegion.java:243)
      	at org.apache.geode.cache.query.internal.CompiledSelect.doNestedIterations(CompiledSelect.java:848)
      	at org.apache.geode.cache.query.internal.CompiledSelect.doIterationEvaluate(CompiledSelect.java:715)
      	at org.apache.geode.cache.query.internal.CompiledSelect.evaluate(CompiledSelect.java:553)
      	at org.apache.geode.cache.query.internal.CompiledSelect.evaluate(CompiledSelect.java:57)
      	at org.apache.geode.cache.query.internal.DefaultQuery.executeUsingContext(DefaultQuery.java:582)
      	at org.apache.geode.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:391)
      

      Attachments

        Activity

          People

            boglesby Barrett Oglesby
            boglesby Barrett Oglesby
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: