Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1432

java.io.NotSerializableException when using OSCache for query cache with prefetches and persitent cache.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0
    • 3.0.2, 3.1M3
    • Core Library
    • SQL Server 2008 10.0.2531.0, OSCache 2.4, jTDS Driver 1.2.4, Kernel: 2.6.31-20-generic

    Description

      When using persistent OSCache with prefetching like:

      SelectQuery q = proto.queryWithParameters(params);
      q.addPrefetch(RichProduct.MANUFACTURER_PROPERTY);
      q.addPrefetch(RichProduct.RAW_PRODUCT_PROPERTY);
      q.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
      q.setCacheGroups("products");

      Upon execution of this query the following exception occurs:

      ERROR com.opensymphony.oscache.base.algorithm.AbstractConcurrentReadCache
      [oscache] Exception persisting RichProduct/subCategory =
      <ObjectId:SubCategory, category_id=1,
      id=1>/categoryName/subCategoryName/cost
      com.opensymphony.oscache.base.persistence.CachePersistenceException:
      Unable to write
      '/tmp/cache/application/0/0/5/005126BC80FABAA4C582919EDF0B9304.cache'
      in the cache. Exception: java.io.NotSerializableException, Message:
      org.apache.cayenne.access.ListWithPrefetches
      at com.opensymphony.oscache.plugins.diskpersistence.AbstractDiskPersistenceListener.store(AbstractDiskPersistenceListener.java:376)
      at com.opensymphony.oscache.plugins.diskpersistence.AbstractDiskPersistenceListener.store(AbstractDiskPersistenceListener.java:238)

      <rest of stack trace removed>

      If the prefetches are removed the issue does not occur.

      If the in memory cache is used the issue does not occur either.

      Attachments

        1. cay-1432.patch
          5 kB
          Dzmitry Kazimirchyk

        Activity

          People

            Unassigned Unassigned
            garyjarrel@gmail.com Gary Jarrel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: