From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-26 02:25:34
|
>Found 2 issues with the current cache code: > >one with the <jcs-cache> tag, i edited vertex.hbm.xml to do my testing. >If i place the <jcs-cache> tag just after the <class> one it "works" , no >error while parsing the xml >If i place the <jcs-cache> tag after </subclass> and before </class> , got >an error parsing the xml: This is intended. I decided it was too easy to miss the <cache> tag where it is now. >Other error comes from the fact the class CacheEntry does not implement >Serializable, it's mandatory that class going to the cache are serializable. >quick fix : ClassPersister.java line 1035 Done. Thanks for that. I had been testing against the in-memory cache only. >- I thought the key was a composite one.... ( tableName + PK ), it appears >it's only the PK ( if we want to be able to share a region cache among > multiple classes we need a unique key) Currently the factory-level caches hold instances of just a single class, hence we don't need to use the tablename. If theres a really good reason why we might want to keep all cached data in a single JCS region, we can actually implement that directly in cirrus.hibernate.JCSCache, since it knows the name of the rootclass it is caching. Actually thst such a small amount of work I might just _do_it_.... Is there any really major advantage to keeping everything in one region? >- Then i try to re enter the show command, i would expect to get some "Cache >hit: xxx" debug info , but i get none.Are we sure that Hibernate does check >the cache properly ? yup, I'm quite sure. But show can't utilize the cache because it uses find() queries. The query goes to the database and retrieves the whole object in one step. If you want to see some cache hits try an iterate() query, or something with associations when use_outer_join is disabled. .....or various other situations where the cache *is* used. P.S. We really need to implement caching for collections if we want to use this stuff most efficiently. I don't think theres anything particularly technically difficult about that ... I just need to *do* it. If anyone else wants to volunteer for this, give me a yell and I'll tell you what needs to be done.... |