-->
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: WPS 6.0, CMT, TreeCache
PostPosted: Mon Jul 17, 2006 9:31 am 
Newbie

Joined: Tue Apr 11, 2006 4:57 am
Posts: 17
Hibernate version: 3.1.3

Hi!
I am using Hibernate under Websphere Process Server (Websphere Application Server) 6.0 with CMT, so these lines in the hibernate.cfg.xml:

Code:
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>


This is in a clustered enviroment (with deployment manager).

I want to use some 2nd level caching mechanism, and I decided to use TreeCache (hibernate.cfg.xml):

Code:
<property name="cache.provider_class">org.hibernate.cache.TreeCacheProvider</property>


When I call session.get I get the following exception:
Code:
[7/17/06 14:04:03:281 CEST] 0000008a ExceptionUtil E   CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "get" on bean "BeanId(BOPersEAR#BOPersEJB.jar#SrvEgyen, null)". Exception data: java.lang.UnsupportedOperationException
   at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter.suspend(WebSphereExtendedJTATransactionLookup.java:105)
   at org.hibernate.cache.TreeCache.suspend(TreeCache.java:101)
   at org.hibernate.cache.TreeCache.put(TreeCache.java:71)
   at org.hibernate.cache.TransactionalCache.put(TransactionalCache.java:50)
   at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:156)
   at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
   at org.hibernate.loader.Loader.doQuery(Loader.java:717)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
   at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)
   at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:47)
   at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:41)
   at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2730)
   at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
   at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
   at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
   at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:177)
   at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
   at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
   at org.hibernate.impl.SessionImpl.get(SessionImpl.java:799)
   at org.hibernate.impl.SessionImpl.get(SessionImpl.java:792)
   at hu.afsz.dao.CommonDAO.getById(CommonDAO.java:73)
   at hu.afsz.srv.ejb.SrvEgyenBean.get(SrvEgyenBean.java:84)
   at hu.afsz.srv.ejb.EJSLocalStatelessSrvEgyen_d0098eb5.get(EJSLocalStatelessSrvEgyen_d0098eb5.java:96)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
   at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
   at com.ibm.etools.utc.model.ReflectionMethodModel.invoke(ReflectionMethodModel.java:65)
   at com.ibm.etools.utc.servlet.InvokeServlet.invoke(InvokeServlet.java:111)
   at com.ibm.etools.utc.servlet.InvokeServlet.doPost(InvokeServlet.java:367)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
   at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:673)
   at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
   at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1804)
   at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
   at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:469)
   at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:408)
   at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
   at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
   at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
   at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
   at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
   at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))


Treecache not supported in WAS 6.0 with CMT (org.hibernate.transaction.WebSphereExtendedJTATransactionLookup)???
Someone has a working example?

My treecache.xml file is:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<server>
    <classpath 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>

        <!--
            Node isolation level : SERIALIZABLE
                                 REPEATABLE_READ (default)
                                 READ_COMMITTED
                                 READ_UNCOMMITTED
                                 NONE
        -->
        <attribute name="IsolationLevel">REPEATABLE_READ</attribute>

        <!--
             Valid modes are LOCAL
                             REPL_ASYNC
                             REPL_SYNC
        -->
        <attribute name="CacheMode">REPL_ASYNC</attribute>

        <!-- Name of cluster. Needs to be the same for all clusters, in order
             to find each other
        -->
        <attribute name="ClusterName">TreeCache-Cluster</attribute>

        <!-- JGroups protocol stack properties. Can also be a URL,
             e.g. file:/home/bela/default.xml
           <attribute name="ClusterProperties"></attribute>
        -->

        <attribute name="ClusterConfig">
            <config>
                <!-- UDP: if you have a multihomed machine,
                set the bind_addr attribute to the appropriate NIC IP address -->
                <!-- UDP: On Windows machines, because of the media sense feature
                 being broken with multicast (even after disabling media sense)
                 set the loopback attribute to true -->
                <UDP mcast_addr="228.1.2.3" mcast_port="45566"
                    ip_ttl="64" ip_mcast="true"
                    mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
                    ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
                    loopback="true"/>
                <PING timeout="2000" num_initial_members="3"
                    up_thread="false" down_thread="false"/>
                <MERGE2 min_interval="10000" max_interval="20000"/>
                <FD shun="true" up_thread="true" down_thread="true"/>
                <VERIFY_SUSPECT timeout="1500"
                    up_thread="false" down_thread="false"/>
                <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
                    up_thread="false" down_thread="false"/>
                <pbcast.STABLE desired_avg_gossip="20000"
                    up_thread="false" down_thread="false"/>
                <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
                    down_thread="false"/>
                <FRAG frag_size="8192"
                    down_thread="false" up_thread="false"/>
                <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
                    shun="true" print_local_addr="true"/>
                <pbcast.STATE_TRANSFER up_thread="false" down_thread="false"/>
            </config>
        </attribute>

        <!--
             Max number of entries in the cache. If this is exceeded, the
             eviction policy will kick some entries out in order to make
             more room
        -->
        <attribute name="MaxCapacity">20000</attribute>

        <!--
            The max amount of time (in milliseconds) we wait until the
            initial state (ie. the contents of the cache) are retrieved from
            existing members in a clustered environment
        -->
        <attribute name="InitialStateRetrievalTimeout">20000</attribute>

        <!--
            Number of milliseconds to wait until all responses for a
            synchronous call have been received.
        -->
        <attribute name="SyncReplTimeout">10000</attribute>

        <!-- Max number of milliseconds to wait for a lock acquisition -->
        <attribute name="LockAcquisitionTimeout">15000</attribute>

        <!-- Max number of milliseconds we hold a lock (not currently
        implemented) -->
        <attribute name="LockLeaseTimeout">60000</attribute>

        <!-- Name of the eviction policy class. Not supported now. -->
        <attribute name="EvictionPolicyClass"></attribute>
    </mbean>
</server>


Please help me ASAP, it's very urgent!
( or it there any better solution for hibernate 2nd level cache in a clustered enviroment? )

thx, Peter


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 12, 2006 9:15 am 
Newbie

Joined: Tue Dec 12, 2006 9:07 am
Posts: 13
Hi Peter,

Did you find a solution to this problem ? I configured Treecache with Websphere though not in a clustered environment but am still running into the problem described above.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 12, 2006 9:31 am 
Regular
Regular

Joined: Wed Mar 23, 2005 8:43 am
Posts: 105
Location: Moscow, Russia
Guys, may be you find useful information in this: http://www-128.ibm.com/developerworks/websphere/techjournal/0609_alcott/0609_alcott.html?S_TACT=105AGX99&S_CMP=CP
artcle about integration Hibernate and WebSphere. Specifically, it points following:

Quote:
At the time of publication, the behavior of Hibernate's cluster aware caches in conjunction with WebSphere Application Server has not been determined; therefore, it is not yet determined whether or not their use is supported and we will not discuss them further. As a result, customers requiring a distributed cache should consider creating a class that implements org.hibernate.cache.CacheProvider using the property hibernate.cache.provider_class, which employs one of the two distributed cache implementations in WebSphere.

_________________
Best Regards


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 26, 2006 4:59 am 
Newbie

Joined: Tue Dec 12, 2006 9:07 am
Posts: 13
After groping around in the dark for a long time, here's the solution to this problem

http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheAndWAS_6.x

Here's an excerpt from the Wiki that will help solve this issue.

Quote:
Since the hibernate Cache class that wraps the treeCache may need to interact with the Transaction Manager, one needs to switch from the WebsphereExtendedJTATransactionManager to the WebsphereTransactionManager in order to be able to suspend/resume transactions
[/url]


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.