<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi there. &nbsp;Sorry for the late response. &nbsp;I know others on this list are also reviewing your code.<div><br></div><div>Some comments in-line:</div><div><br><div><div>On 28 Nov 2011, at 13:13, Zdeněk Henek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br><br>I am working on prototype of <a href="https://issues.jboss.org/browse/ISPN-465">https://issues.jboss.org/browse/ISPN-465</a>.<br><br>Currently works basic functionality like create session, add,update,<br>remove values from session, remove session.<br>Session could be with or without jvmRoute ... see details<br>here:https://github.com/zvrablik/tomcatInfinispanSessionManager)<br><br>I have a few questions related to infinispan.<br><br>1. classloading issue when used only one shared classloader<br>============================================<br><br>Current master (<a href="https://github.com/zvrablik/tomcatInfinispanSessionManager">https://github.com/zvrablik/tomcatInfinispanSessionManager</a>)<br>creates<br>cache manager per war application. I would like use one shared cache manager.<br>Is it possible?<br></div></blockquote><div><br></div><div>Yes you can, however you'd need a place to register it. &nbsp;I'm not sure what Tomcat offers - in JBoss AS 7, it is stored as an AS 7 service. &nbsp;Other options may include JNDI or JMX.</div><br><blockquote type="cite"><div><br>I have created branch<br>(<a href="https://github.com/zvrablik/tomcatInfinispanSessionManager/tree/classloader">https://github.com/zvrablik/tomcatInfinispanSessionManager/tree/classloader</a>)<br>where only first InfinispanSessionManager create DefaultCacheManager.<br><br>All created caches set explicitly class loader to configuration and<br>DecoratedCache is used to access cache.<br>See InfinispanSessionManager.initInfinispan method.<br><br>my infinispan configuration (all created caches use default settings):<br>&lt;infinispan xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xsi:schemaLocation="urn:infinispan:config:5.0<br><a href="http://www.infinispan.org/schemas/infinispan-config-5.0.xsd">http://www.infinispan.org/schemas/infinispan-config-5.0.xsd</a>"<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns="urn:infinispan:config:5.0"&gt;<br> &nbsp;&lt;global&gt;<br> &nbsp;&nbsp;&nbsp;&lt;transport clusterName="tomcatSession"/&gt;<br> &nbsp;&nbsp;&nbsp;&lt;globalJmxStatistics enabled="true" allowDuplicateDomains="true"/&gt;<br> &nbsp;&lt;/global&gt;<br>&lt;!-- use only default cache for all caches created by session manger --&gt;<br>&lt;!-- to specify custom parameters to one cache create named cache with<br>name _session_attrContainerName<br>where ContainerName is name of war application --&gt;<br><br> &nbsp;&lt;default&gt;<br> &nbsp;&nbsp;&nbsp;&lt;jmxStatistics enabled="true"/&gt;<br> &nbsp;&nbsp;&nbsp;&lt;clustering mode="distribution"&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;l1 enabled="false" lifespan="600000"/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;hash numOwners="2" rehashRpcTimeout="6000"/&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;sync/&gt;<br> &nbsp;&nbsp;&nbsp;&lt;/clustering&gt;<br> &nbsp;&nbsp;&nbsp;&lt;invocationBatching enabled="true"/&gt;<br> &nbsp;&lt;/default&gt;<br>&lt;/infinispan&gt;<br><br>I use tomcat 6.0.29 and Infinispan 5.1.Beta5, java 6 update 26 on<br>Debian stable 64bit.<br><br>I get exception on node which should replicate state sent from another node.<br>See attached tomcat log.<br><br>The missing class is available only through testLB war application classloader.<br><br>2. locking and distributed transactions<br>============================<br>I use FineGrainedAtomicMap to store session attriubtes. I don't use<br>any locking nor XA transactions.<br>Do I have to use locking or XA transactions? I think autocommit mode<br>could be better in this case<br><span class="Apple-tab-span" style="white-space:pre">        </span>and tomcat doesn't have XA manager by default. I am using distributed<br>transactions only in relational databases.<br></div></blockquote><div><br></div><div>Yes, you probably don't need full XA. &nbsp;Using Synchronizations should be enough. &nbsp;If you need a full transaction manager, you could pull in JBoss TS as a dependency, which is embeddable.</div><div><br></div><div><a href="https://github.com/infinispan/infinispan/blob/master/parent/pom.xml#L201">https://github.com/infinispan/infinispan/blob/master/parent/pom.xml#L201</a></div><div><a href="https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/transaction/lookup/JBossStandaloneJTAManagerLookup.java">https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/transaction/lookup/JBossStandaloneJTAManagerLookup.java</a></div><br><blockquote type="cite"><div><br>3. propagating session events to other nodes, sharing session metadata<br>==============================================<br>Is it possible to send (broadcast) custom events through Infinispan?<br></div></blockquote><div><br></div><div>No.</div><br><blockquote type="cite"><div><br>Currently it is possible to remove session from all nodes when session<br>is removed in any node,<br>but there must be done more. Session timeout, session custom events ...<br><br>other possible aproach is to create separated cache with session metadata.<br>I think creating new cache for metadata is better approach. I think<br>there will be<br><span class="Apple-tab-span" style="white-space:pre">        </span>less network traffic when nodes will get information only when requested.<br><br>session object could have assigned listeners and broadcast events<br>which are not related to session attributes.<br></div></blockquote><div><br></div><div>Yes, this is possibly a better approach, however others on this list could comment more.</div><div><br></div><div>Cheers</div><div>Manik</div><div>--</div></div><div apple-content-edited="true"><div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div><a href="http://twitter.com/maniksurtani">twitter.com/maniksurtani</a></div><div><br></div><div>Lead, Infinispan</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><br></div></div><br class="Apple-interchange-newline">
</div>
<br></div></body></html>