-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: multiple class versions in Hibernate L2 cache
PostPosted: Mon Sep 24, 2012 5:11 pm 
Newbie

Joined: Thu Sep 20, 2012 6:02 pm
Posts: 1
Hi,

I have several servers using Hibernate 3.3 for reading/writing objects of class 'C'. Every once in a while I modify the DB schema (i.e. add new fields), and update class 'C' accordingly.
As I was planning to add an L2 cache (memcached) for performance reasons, I stumbled across the following problem:

The upgrade process takes an hour or so, during which the servers are upgraded one after the other.
If a server that was already upgraded tries to fetch an object from the cache, and this object was not yet modified in the Cache to include the new fields, Hibernate generates an 'ArrayOutOfBounds' Exception upon trying to de-serialize the old shorter object using the new longer definition.

Is there an elegant way avoid this exception, e.g. override the serialization process?
Is there a better way to tackle this issue altogether?

Please note that this problem has nothing to do with with the actual cache mechanism. The 'problematic' code is in Hibernate: TypeFactory.assemble().


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.