-->
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: Is map caching supported? Please help
PostPosted: Wed Feb 22, 2006 6:55 pm 
Newbie

Joined: Wed Feb 22, 2006 6:25 pm
Posts: 4
Hi, I like hibernate much (i just love it),
it speed up my development process,
but I i've problems with performance, I've enabled second-level
cache, but i've one problem:

does Hibernate second-level cache support maps?

this is part of my project (hbm.xml)
(should) represent a simple parent-child relation
Code:
<hibernate-mapping>
    <class name="N" table="N" lazy="true" >   
        <cache usage="read-write" />   
            <id name="id" column="ID">
   <generator class="native" />
            </id>
...
            <map name="children" table="NC" cascade="all" lazy="extra">
               <cache usage="read-write" />
     <key column="N_ID" />
     <map-key column="KEY" type="char" />
     <one-to-many class="N" />
            </map>
      </class>
</hibernate-mapping>


I've few questions about it:
Hibernate 3.1 created such table

Code:
TABLE N (ID, N_ID, KEY)


after turning on caching any configuring project according to provided samples - hibernate seems to enable caching for N, but not for map
- a many queries (SELECT ID FROM N WHERE N_ID=? AND KEY=?) seem to slow down application.

I've similar problems with other maps in my application.

Quote:
1)
So my question is - does Hibernate support caching maps? Is it dependent of cache implemetation?

2)
Quote:
Second question is quite pragmatic - how to keep map implemetation in a separate table? At this point hibernate doesn't put relation in a separate table, but in a parent's table (N).


Code:
TABLE N(ID)
TABLE NC(ID,N_PARENT,N_CHILD,N_KEY)


3)
Quote:
Third question - is there more effective model or Tree than provided above?


4)
Quote:
Last question - how long does Hibernate cache objects? Is lifetime of objects in cache is dependent of transaction or session?


I would apreciate any help with these problems,
Thank you,
Dominik


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.