|
Hibernate now contains a new CacheProvider named JndiBoundTreeCacheProvider. Its purpose is to locate an existing TreeCache instance from a JNDI lookup and use that as the backing for the 2nd level cache. Also, be sure to set the new hibernate.cache.jndi property to the JNDI namespace where the TreeCache instance is bound.
Good, but as TreeCache does not support JNDI anymore, the registration there has to be done by some extra piece of code?
Well, as I have mentioned numerous times JBoss has its own hibernate cache provider, which will be re-purposed to use a deployed tree cache mbean "directly"; meaning you will simply configure the ObjectName for the tree cache hibernate shoulld use as its 2nd level cache.
That is all JBoss specific, the JNDI piece is AS-agnostic. |
||||||||||||||||||||||||||||||||||||||||||||
It relies on a TreeCache being available through JNDI, which was a feature added to JBoss TreeCache MBean (although, certainly, anything could bind TreeCache into JNDI). That particular feature is being removed from the latest TreeCache.
At some point, I will move that provider over to the Hibernate source tree, based on the refactorings I did in the Cache/CacheProvider structure.
In the meantime, feel free to use the Provider I mentioned above.
I'll leave this case open lest I forget to do that source move.