-->
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.  [ 4 posts ] 
Author Message
 Post subject: Tomcat and TreeCache
PostPosted: Tue Oct 26, 2004 11:27 am 
Newbie

Joined: Tue Oct 26, 2004 8:21 am
Posts: 2
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?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 12:22 pm 
Beginner
Beginner

Joined: Fri Aug 13, 2004 3:07 pm
Posts: 44
Don;t know if this is the same, but I had an issue when I used EHcache.

I specified the cache tag in my hbm file as read-only for that object and then tried to create a new object and save it. Have you done the same thing?
If so change your cache tag to specify read-write and thigs may be fine.

Hope it helps !!! If not, I don't know what to say.

_________________
Thanks
Sameet


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 27, 2004 12:44 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
The JBossCache provider only supports read-only and transactional cache usages. You have specified something other than one of these two in one of your cache elements.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 28, 2004 5:15 am 
Newbie

Joined: Tue Oct 26, 2004 8:21 am
Posts: 2
Thanks Steve.

I put the usage attributes' value as transactional and everything is fine.

:beer:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

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.