-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate + JBossCache
PostPosted: Wed Aug 24, 2005 10:59 am 
Beginner
Beginner

Joined: Tue Dec 21, 2004 11:53 am
Posts: 42
Hibernate version:
2.1.6

Hello, I'm using Hibernate with JBoss 4.0.1 and I'm deploying my persistent classes as Hibernate archive. Now I need to integrate with jboss cache. I've found a few tutorials but I havent been able to do so. Here's my hibernate-service.xml from my .har

server>
<classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=DrogatelHibernate">
<attribute name="DatasourceName">java:/myDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.SQLServerDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/MySessionFactory</attribute>
<attribute name="CacheProviderClass">
net.sf.hibernate.cache.TreeCacheProvider
</attribute>
<attribute name="DeployedTreeCacheJndiName">
java:/hibernate/TreeCache
</attribute>
<attribute name="ShowSqlEnabled">true</attribute>
</mbean>

<mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
<depends>jboss:service=Naming</depends>
<depends>jboss:service=TransactionManager</depends>
<attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
<attribute name="IsolationLevel">REPEATABLE_READ</attribute>
<attribute name="CacheMode">LOCAL</attribute>
<attribute name="ClusterName">TreeCache-Cluster</attribute>
</mbean>
</server>

Well as I took it from examples, I did not quite get the idea behind the deployedTreeCacheJNDI name, since my treecache mbean is not on my JNDI name space. Could someone give me a working example?

Thanks

Vinicius


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 24, 2005 3:15 pm 
Beginner
Beginner

Joined: Tue Dec 21, 2004 11:53 am
Posts: 42
Holy Sh***. I'm very mad at Hibernate documentation at this point. although I've found some wiki info:
http://wiki.jboss.org/wiki/Wiki.jsp?pag ... Hibernate2
There's no info on integration with JBossCache. Ok So I tried the Hibernate 3 page and found some help :D I've end up with this:

<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=DrogatelHibernate">
<depends>jboss:service=Naming</depends>
<depends>jboss:service=TransactionManager</depends>
<depends>jboss.cache:service=TreeCache</depends>
<attribute name="CacheProviderClass">org.jboss.hibernate.cache.DeployedTreeCacheProvider</attribute>
<attribute name="DeployedTreeCacheJndiName">jboss.cache:service=TreeCache</attribute>
<attribute name="DatasourceName">java:/DrogatelDS</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.SQLServerDialect</attribute>
<attribute name="SessionFactoryName">java:/hibernate/DrogatelSessionFactory</attribute>
<attribute name="ShowSqlEnabled">true</attribute>
</mbean>
</server>

<server>
<classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
<mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
<depends>jboss:service=Naming</depends>
<depends>jboss:service=TransactionManager</depends>
<attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
<attribute name="IsolationLevel">REPEATABLE_READ</attribute>
<attribute name="CacheMode">LOCAL</attribute>
<attribute name="ClusterName">TreeCache-Cluster</attribute>
</mbean>
</server>

Well, everthing looked fine, but ... hibernate.deployer is meant for 3.x version... digging wiki I've found the 2.x version.

Ok, now my problem is that the deployer can not find the jndi name provided. I shall remember those willing to help ;) that that configuration was an Hibernate wiki suggestion.

Could someone please help me? I promise Ill create a cool wiki about the topic afterwards...


Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.