Hi everybody.
I'm trying to prepare a developpent platform using :
- Tomcat 5.0
- Hibernate 2.1.4
- TreeCache (version as in Hibernate)
- JTOM 1.5.3
I declare the utilization of the TreeCacheProvider in the hibernate.cfg.xml
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/testCache</property>
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<!-- Cache-->
<property name="hibernate.cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</property>
<!-- Mapping files -->
<mapping resource="TestCache.hbm.xml"/>
</session-factory>
</hibernate-configuration>
If I use the file treecache.xml shipped with hibernate I have the exception
Code:
Location
org.jboss.cache.transaction.DummyTransactionManager.getInstance(DummyTransactionManager.java:46)
Stack Trace
javax.naming.NamingException: Context is read only
at org.apache.naming.NamingContext.checkWritable(NamingContext.java:901)
at org.apache.naming.NamingContext.bind(NamingContext.java:829)
at org.apache.naming.NamingContext.bind(NamingContext.java:169)
at org.apache.naming.NamingContext.bind(NamingContext.java:185)
at org.apache.naming.SelectorContext.bind(SelectorContext.java:170)
at javax.naming.InitialContext.bind(InitialContext.java:355)
...
If i don't set any transaction manager lookup or if I set it using the "hibernate.transaction.manager_lookup_class" hibernate's property (using JOT) i have the following runtime exception:
Code:
exception
org.apache.jasper.JasperException: TreeCache is a fully transactional cache: /test/TestCache
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.UnsupportedOperationException: TreeCache is a fully transactional cache: /test/TestCache
net.sf.hibernate.cache.TreeCache.unlock(TreeCache.java:101)
net.sf.hibernate.cache.ReadWriteCache.get(ReadWriteCache.java:94)
net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2104)
net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1987)
net.sf.hibernate.impl.SessionImpl.get(SessionImpl.java:1923)
Any suggestion to make TreeCache and Tomcat working together?