[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-2808) CLONE -Impossible to define caching for a subclass's collection in hibernate.cgf.xml

Steve Ebersole (JIRA) noreply at atlassian.com
Wed Aug 29 07:10:24 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2808?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-2808.
-------------------------------

    Resolution: Rejected

1) For inheritance hierarchies, caching is defined for the whole hierarchy, not individual subclasses;
2) The caching of collections must be defined "at the level" where the collection is defined.

> CLONE -Impossible to define caching for a subclass's collection in hibernate.cgf.xml 
> -------------------------------------------------------------------------------------
>
>                 Key: HHH-2808
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2808
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: caching (L2)
>    Affects Versions: 3.2.5
>         Environment: Hibernate 3.2.5
> Sybase
>            Reporter: Sebastien Blind
>
> Basically, hibernate allows to define <cache usage="transactional"/> inside the subclass mapping, i.e.
> <subclass name="SubClass" extends="BaseClass" discriminator-value="xxx">
>         <bag name="subClassLinks" lazy="false" inverse="true" batch-size="100">
>             <cache usage="transactional" region="xxx"/>
>     		<key column="xxx" not-null="true"/>
>     		<one-to-many class="xxx"/>
>         </bag>    
>     
>         <join table="xxx">
>         </join>
> </subclass>
> but it's not allowed to do the same using <collection-cache collection="subClass.myCollection" region="xxx" usage="transactional"/>.
> It throws:
> Exception in thread "main" org.hibernate.MappingException: Cannot cache an unknown collection: subClass.myCollection
> 	at org.hibernate.cfg.Configuration.setCollectionCacheConcurrencyStrategy(Configuration.java:1984)
> 	at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1568)
> 	at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534)
> 	at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508)
> 	at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list