-->
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: Hibernate cache not working for bags?
PostPosted: Tue Mar 01, 2011 9:02 am 
Newbie

Joined: Tue Mar 01, 2011 8:54 am
Posts: 5
Caching queries like "select cat.eyes from Cat cat where cat.id=?" where cat.eyes is a Bag does not work - cache returns a list with one element in it - null.
Reasons: StandardQueryCache contains following code:
Code:
         for ( int i = 0; i < result.size(); i++ ) {
            if ( returnTypes.length == 1 ) {
               cacheable.add( returnTypes[0].disassemble( result.get( i ), session, null ) );
            }
            else {
               cacheable.add(
                     TypeFactory.disassemble(
                           ( Object[] ) result.get( i ), returnTypes, null, session, null
                     )
               );
            }
         }

Where returnTypes is [org.hibernate.type.BagType] and BagType.disassemble requires owner argument which is passed as null - see last arg at
Code:
returnTypes[0].disassemble( result.get( i ), session, null )


In other words, if we are caching Bag, BagType.disassemble is called with owner=null and current implementation returns null if there is no owner.

Is this behaviour intentional? Or will it be fixed? How can i cache bags?


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.