[infinispan-dev] tomcat infinispan session manager

Zdeněk Henek vrablik at gmail.com
Mon Nov 28 08:13:58 EST 2011


Hi,

I am working on prototype of https://issues.jboss.org/browse/ISPN-465.

Currently works basic functionality like create session, add,update,
remove values from session, remove session.
Session could be with or without jvmRoute ... see details
here:https://github.com/zvrablik/tomcatInfinispanSessionManager)

I have a few questions related to infinispan.

1. classloading issue when used only one shared classloader
============================================

Current master (https://github.com/zvrablik/tomcatInfinispanSessionManager)
creates
cache manager per war application. I would like use one shared cache manager.
Is it possible?

I have created branch
(https://github.com/zvrablik/tomcatInfinispanSessionManager/tree/classloader)
where only first InfinispanSessionManager create DefaultCacheManager.

All created caches set explicitly class loader to configuration and
DecoratedCache is used to access cache.
See InfinispanSessionManager.initInfinispan method.

my infinispan configuration (all created caches use default settings):
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="urn:infinispan:config:5.0
http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"
            xmlns="urn:infinispan:config:5.0">
  <global>
    <transport clusterName="tomcatSession"/>
    <globalJmxStatistics enabled="true" allowDuplicateDomains="true"/>
  </global>
<!-- use only default cache for all caches created by session manger -->
<!-- to specify custom parameters to one cache create named cache with
name _session_attrContainerName
where ContainerName is name of war application -->

  <default>
    <jmxStatistics enabled="true"/>
    <clustering mode="distribution">
      <l1 enabled="false" lifespan="600000"/>
      <hash numOwners="2" rehashRpcTimeout="6000"/>
      <sync/>
    </clustering>
    <invocationBatching enabled="true"/>
  </default>
</infinispan>

I use tomcat 6.0.29 and Infinispan 5.1.Beta5, java 6 update 26 on
Debian stable 64bit.

I get exception on node which should replicate state sent from another node.
See attached tomcat log.

The missing class is available only through testLB war application classloader.

2. locking and distributed transactions
============================
I use FineGrainedAtomicMap to store session attriubtes. I don't use
any locking nor XA transactions.
Do I have to use locking or XA transactions? I think autocommit mode
could be better in this case
	and tomcat doesn't have XA manager by default. I am using distributed
transactions only in relational databases.

3. propagating session events to other nodes, sharing session metadata
==============================================
Is it possible to send (broadcast) custom events through Infinispan?

Currently it is possible to remove session from all nodes when session
is removed in any node,
but there must be done more. Session timeout, session custom events ...

other possible aproach is to create separated cache with session metadata.
I think creating new cache for metadata is better approach. I think
there will be
	less network traffic when nodes will get information only when requested.

session object could have assigned listeners and broadcast events
which are not related to session attributes.


Thanks for help.

Regards,
Zdenek Henek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: catalinaInfinispanClassloadingIssue.out
Type: application/octet-stream
Size: 15155 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/infinispan-dev/attachments/20111128/11bbc724/attachment.obj 


More information about the infinispan-dev mailing list