Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8030393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:45:15+00:00 2026-06-05T00:45:15+00:00

I have a class ‘Company’ that is being mapped using NHibernate and cached in

  • 0

I have a class ‘Company’ that is being mapped using NHibernate and cached in the second-level cache (memcached). Our team recently added a new bool property to this class which will be stored in the database.

Everything worked fine in our development environment, but as soon as we deployed to our staging environment (which shares the live database) we started getting the following error:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
at (Object , Object[] , SetterCallback )
at NHibernate.Tuple.Entity.PocoEntityTuplizer.SetPropertyValuesWithOptimizer(Object entity, Object[] values)
at NHibernate.Tuple.Entity.PocoEntityTuplizer.SetPropertyValues(Object entity, Object[] values)
at NHibernate.Persister.Entity.AbstractEntityPersister.SetPropertyValues(Object obj, Object[] values, EntityMode entityMode)
at NHibernate.Cache.Entry.CacheEntry.Assemble(Object[] values, Object result, Object id, IEntityPersister persister, IInterceptor interceptor, ISessionImplementor session)
at NHibernate.Cache.Entry.CacheEntry.Assemble(Object instance, Object id, IEntityPersister persister, IInterceptor interceptor, ISessionImplementor session)
at NHibernate.Event.Default.DefaultLoadEventListener.AssembleCacheEntry(CacheEntry entry, Object id, IEntityPersister persister, LoadEvent event)
at NHibernate.Event.Default.DefaultLoadEventListener.LoadFromSecondLevelCache(LoadEvent event, IEntityPersister persister, LoadType options)
at NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options)

My best guess is that NHibernate can’t deserialize the old cache entries (which don’t have the new property) into the new Company object. I believe I confirmed this, because I disabled the second-level cache in our staging environment and the ISEs stopped.

So I guess my question is how can we force NHibernate to fall through to the database if it can’t deserialize a cache entry instead of bubbling up an exception? Has anyone else run into this problem?

I think right now, we’re going to have to deploy with second-level caching turned off, restart the memcached servers and then re-enable second-level caching. However, this solution is not ideal. If anyone has a better suggestion I’d be very thankful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:45:17+00:00Added an answer on June 5, 2026 at 12:45 am

    As an update for anyone who is interested, I followed the steps outlined in my post:

    […] we’re going to have to deploy with second-level caching turned off, restart the memcached servers and then re-enable second-level caching.

    …and everything worked ok. It was bit more complicated than our normal deploys, but we didn’t have any errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have class that represents users. Users are divided into two groups with different
I have class ParentClass that observes an NSNotification. ParentClass handles the notification. ChildClass inherits
I have class class DateOptTimeType implements org.hibernate.usertype.UserType that works with two columns @org.hibernate.annotations.Type(type =
I have class B that has class A, this is simplified version of class
I have class instantiated in a web service that, in a static member, holds
I have class that extends BroadcastReceiver and gets all new sms. When I get
I have class User that contains protected constructor and class Account that has access
I have class which has a method that needs to return three DataTables. I
I have class that holds Tree Items for a Tree. Say the constructor looks
I have class that is a DataContract and the member values are holding default

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.